You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"Zip64 end of central directory record" may have additional data in the "zip64 extensible data sector" field.
In that case, zipfile should use offset from "Zip64 end of central directory locator".
Now it's read but ignored.
defrun_test():
withzipfile.ZipFile("file-with-extended-zip64eocd-record.zip", allowZip64=True) asspecial_file: # This failsprint("success")
Problem lies in following code:
sig, diskno, reloff, disks=struct.unpack(structEndArchive64Locator, data)
ifsig!=stringEndArchive64Locator:
returnendrecifdiskno!=0ordisks>1:
raiseBadZipFile("zipfiles that span multiple disks are not supported")
# Assume no 'zip64 extensible data'fpin.seek(offset-sizeEndCentDir64Locator-sizeEndCentDir64, 2)
data=fpin.read(sizeEndCentDir64)
While it should be:
sig, diskno, reloff, disks=struct.unpack(structEndArchive64Locator, data)
ifsig!=stringEndArchive64Locator:
returnendrecifdiskno!=0ordisks>1:
raiseBadZipFile("zipfiles that span multiple disks are not supported")
fpin.seek(reloff, 0)
data=fpin.read(sizeEndCentDir64)
Bug report
Bug description:
"Zip64 end of central directory record" may have additional data in the "zip64 extensible data sector" field.
In that case, zipfile should use offset from "Zip64 end of central directory locator".
Now it's read but ignored.
Problem lies in following code:
While it should be:
CPython versions tested on:
CPython main branch
Operating systems tested on:
macOS
Linked PRs
The text was updated successfully, but these errors were encountered: