@@ -7229,6 +7229,9 @@ def AppendFilesWithContentFromZipFileToList(infile, extradata=[], jsondata={}, c
72297229 fcontents.write(zipfp.read(member.filename))
72307230 typechecktest = CheckCompressionType(fcontents, filestart=0, closefp=False)
72317231 fcontents.seek(0, 0)
7232+ if(typechecktest is not False):
7233+ typechecktest = GetBinaryFileType(fcontents, filestart=0, closefp=False)
7234+ fcontents.seek(0, 0)
72327235 fcencoding = GetFileEncoding(fcontents, 0, False)[0]
72337236 if(typechecktest is False and not compresswholefile):
72347237 fcontents.seek(0, 2)
@@ -7462,6 +7465,9 @@ def AppendFilesWithContentFromRarFileToList(infile, extradata=[], jsondata={}, c
74627465 fcontents.write(rarfp.read(member.filename))
74637466 typechecktest = CheckCompressionType(fcontents, filestart=0, closefp=False)
74647467 fcontents.seek(0, 0)
7468+ if(typechecktest is not False):
7469+ typechecktest = GetBinaryFileType(fcontents, filestart=0, closefp=False)
7470+ fcontents.seek(0, 0)
74657471 fcencoding = GetFileEncoding(fcontents, 0, False)[0]
74667472 if(typechecktest is False and not compresswholefile):
74677473 fcontents.seek(0, 2)
@@ -7696,6 +7702,9 @@ def AppendFilesWithContentFromSevenZipFileToList(infile, extradata=[], jsondata=
76967702 fcontents.seek(0, 0)
76977703 typechecktest = CheckCompressionType(fcontents, filestart=0, closefp=False)
76987704 fcontents.seek(0, 0)
7705+ if(typechecktest is not False):
7706+ typechecktest = GetBinaryFileType(fcontents, filestart=0, closefp=False)
7707+ fcontents.seek(0, 0)
76997708 fcencoding = GetFileEncoding(fcontents, 0, False)[0]
77007709 try:
77017710 file_content[member.filename].close()
@@ -10998,6 +11007,10 @@ def RePackCatFile(infile, outfile, fmttype="auto", compression="auto", compressw
1099811007 typechecktest = CheckCompressionType(fcontents, filestart=0, closefp=False)
1099911008 fcontents.seek(0, 0)
1100011009
11010+ if(typechecktest is not False):
11011+ typechecktest = GetBinaryFileType(fcontents, filestart=0, closefp=False)
11012+ fcontents.seek(0, 0)
11013+
1100111014 # get fcencoding once here
1100211015 fcencoding = GetFileEncoding(fcontents, 0, False)[0]
1100311016
0 commit comments