@@ -7223,6 +7223,9 @@ def AppendFilesWithContentFromZipFileToList(infile, extradata=[], jsondata={}, c
72237223 fcontents.write(zipfp.read(member.filename))
72247224 typechecktest = CheckCompressionType(fcontents, filestart=0, closefp=False)
72257225 fcontents.seek(0, 0)
7226+ if(typechecktest is not False):
7227+ typechecktest = GetBinaryFileType(fcontents, filestart=0, closefp=False)
7228+ fcontents.seek(0, 0)
72267229 fcencoding = GetFileEncoding(fcontents, 0, False)[0]
72277230 if(typechecktest is False and not compresswholefile):
72287231 fcontents.seek(0, 2)
@@ -7456,6 +7459,9 @@ def AppendFilesWithContentFromRarFileToList(infile, extradata=[], jsondata={}, c
74567459 fcontents.write(rarfp.read(member.filename))
74577460 typechecktest = CheckCompressionType(fcontents, filestart=0, closefp=False)
74587461 fcontents.seek(0, 0)
7462+ if(typechecktest is not False):
7463+ typechecktest = GetBinaryFileType(fcontents, filestart=0, closefp=False)
7464+ fcontents.seek(0, 0)
74597465 fcencoding = GetFileEncoding(fcontents, 0, False)[0]
74607466 if(typechecktest is False and not compresswholefile):
74617467 fcontents.seek(0, 2)
@@ -7690,6 +7696,9 @@ def AppendFilesWithContentFromSevenZipFileToList(infile, extradata=[], jsondata=
76907696 fcontents.seek(0, 0)
76917697 typechecktest = CheckCompressionType(fcontents, filestart=0, closefp=False)
76927698 fcontents.seek(0, 0)
7699+ if(typechecktest is not False):
7700+ typechecktest = GetBinaryFileType(fcontents, filestart=0, closefp=False)
7701+ fcontents.seek(0, 0)
76937702 fcencoding = GetFileEncoding(fcontents, 0, False)[0]
76947703 try:
76957704 file_content[member.filename].close()
@@ -10992,6 +11001,10 @@ def RePackNeoFile(infile, outfile, fmttype="auto", compression="auto", compressw
1099211001 typechecktest = CheckCompressionType(fcontents, filestart=0, closefp=False)
1099311002 fcontents.seek(0, 0)
1099411003
11004+ if(typechecktest is not False):
11005+ typechecktest = GetBinaryFileType(fcontents, filestart=0, closefp=False)
11006+ fcontents.seek(0, 0)
11007+
1099511008 # get fcencoding once here
1099611009 fcencoding = GetFileEncoding(fcontents, 0, False)[0]
1099711010
0 commit comments