@@ -7230,6 +7230,9 @@ def AppendFilesWithContentFromZipFileToList(infile, extradata=[], jsondata={}, c
72307230 fcontents.write(zipfp.read(member.filename))
72317231 typechecktest = CheckCompressionType(fcontents, filestart=0, closefp=False)
72327232 fcontents.seek(0, 0)
7233+ if(typechecktest is not False):
7234+ typechecktest = GetBinaryFileType(fcontents, filestart=0, closefp=False)
7235+ fcontents.seek(0, 0)
72337236 fcencoding = GetFileEncoding(fcontents, 0, False)[0]
72347237 if(typechecktest is False and not compresswholefile):
72357238 fcontents.seek(0, 2)
@@ -7463,6 +7466,9 @@ def AppendFilesWithContentFromRarFileToList(infile, extradata=[], jsondata={}, c
74637466 fcontents.write(rarfp.read(member.filename))
74647467 typechecktest = CheckCompressionType(fcontents, filestart=0, closefp=False)
74657468 fcontents.seek(0, 0)
7469+ if(typechecktest is not False):
7470+ typechecktest = GetBinaryFileType(fcontents, filestart=0, closefp=False)
7471+ fcontents.seek(0, 0)
74667472 fcencoding = GetFileEncoding(fcontents, 0, False)[0]
74677473 if(typechecktest is False and not compresswholefile):
74687474 fcontents.seek(0, 2)
@@ -7697,6 +7703,9 @@ def AppendFilesWithContentFromSevenZipFileToList(infile, extradata=[], jsondata=
76977703 fcontents.seek(0, 0)
76987704 typechecktest = CheckCompressionType(fcontents, filestart=0, closefp=False)
76997705 fcontents.seek(0, 0)
7706+ if(typechecktest is not False):
7707+ typechecktest = GetBinaryFileType(fcontents, filestart=0, closefp=False)
7708+ fcontents.seek(0, 0)
77007709 fcencoding = GetFileEncoding(fcontents, 0, False)[0]
77017710 try:
77027711 file_content[member.filename].close()
@@ -10999,6 +11008,10 @@ def RePackFoxFile(infile, outfile, fmttype="auto", compression="auto", compressw
1099911008 typechecktest = CheckCompressionType(fcontents, filestart=0, closefp=False)
1100011009 fcontents.seek(0, 0)
1100111010
11011+ if(typechecktest is not False):
11012+ typechecktest = GetBinaryFileType(fcontents, filestart=0, closefp=False)
11013+ fcontents.seek(0, 0)
11014+
1100211015 # get fcencoding once here
1100311016 fcencoding = GetFileEncoding(fcontents, 0, False)[0]
1100411017
0 commit comments