gh-89739: gh-77140: Support zip64 in zipimport (GH-94146)

* Reads zip64 files as produced by the zipfile module
* Include tests (somewhat slow, however, because of the need to create "large" zips)
* About the same amount of strictness reading invalid zip files as zipfile has
* Still works on files with prepended data (like pex)

There are a lot more test cases at https://github.com/thatch/zipimport64/ that give me confidence that this works for real-world files.

Fixes #89739 and #77140.

---------

Co-authored-by: Itamar Ostricher <itamarost@gmail.com>
Reviewed-by: Gregory P. Smith <greg@krypto.org>
This commit is contained in:
Tim Hatch 2024-03-27 23:54:51 -07:00 • committed by GitHub
parent 2cedd25c14
commit b44898299a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 154 additions and 39 deletions

View file

@ -30,6 +30,9 @@ Any files may be present in the ZIP archive, but importers are only invoked for
corresponding :file:`.pyc` file, meaning that if a ZIP archive
doesn't contain :file:`.pyc` files, importing may be rather slow.
.. versionchanged:: 3.13
ZIP64 is supported
.. versionchanged:: 3.8
Previously, ZIP archives with an archive comment were not supported.