Skip to content

Commit e78f5b0

Browse files
author
Kazuki Suzuki Przyborowski
committed
Update pycatfile.py
1 parent 2e3f250 commit e78f5b0

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

pycatfile.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6347,6 +6347,9 @@ def ArchiveFileSeekToFileName(infile, seekfile=None, listonly=False, contentasfi
63476347
shutil.copyfileobj(sys.stdin, fp)
63486348
fp.seek(0, 0)
63496349
fp = UncompressArchiveFile(fp, formatspecs)
6350+
checkcompressfile = CheckCompressionSubType(fp, formatspecs, True)
6351+
if(IsNestedDict(formatspecs) and checkcompressfile in formatspecs):
6352+
formatspecs = formatspecs[checkcompressfile]
63506353
if(not fp):
63516354
return False
63526355
fp.seek(0, 0)
@@ -6355,12 +6358,18 @@ def ArchiveFileSeekToFileName(infile, seekfile=None, listonly=False, contentasfi
63556358
fp.write(infile)
63566359
fp.seek(0, 0)
63576360
fp = UncompressArchiveFile(fp, formatspecs)
6361+
checkcompressfile = CheckCompressionSubType(fp, formatspecs, True)
6362+
if(IsNestedDict(formatspecs) and checkcompressfile in formatspecs):
6363+
formatspecs = formatspecs[checkcompressfile]
63586364
if(not fp):
63596365
return False
63606366
fp.seek(0, 0)
63616367
elif(re.findall("^(http|https|ftp|ftps|sftp):\\/\\/", infile)):
63626368
fp = download_file_from_internet_file(infile)
63636369
fp = UncompressArchiveFile(fp, formatspecs)
6370+
checkcompressfile = CheckCompressionSubType(fp, formatspecs, True)
6371+
if(IsNestedDict(formatspecs) and checkcompressfile in formatspecs):
6372+
formatspecs = formatspecs[checkcompressfile]
63646373
fp.seek(0, 0)
63656374
if(not fp):
63666375
return False

0 commit comments

Comments
 (0)