Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Cannot open zip64 file if Zip64EOCD record has additional data #126834

Labels
stdlibPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or error
@VladRassokhin

Description

@VladRassokhin

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.

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)

CPython versions tested on:

CPython main branch

Operating systems tested on:

macOS

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or error

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp