gh-61206: Support zstandard compression in the zipimport module#138254
Merged
gpshead merged 3 commits intopython:mainfrom Sep 2, 2025
Merged
gh-61206: Support zstandard compression in the zipimport module#138254gpshead merged 3 commits intopython:mainfrom
gpshead merged 3 commits intopython:mainfrom
Conversation
emmatyping
approved these changes
Sep 1, 2025
Member
emmatyping
left a comment
There was a problem hiding this comment.
Exciting! This would be really useful for compatibility if wheels can adopt using zstd in the future.
|
picnixz
reviewed
Sep 2, 2025
| _importing_zstd = True | ||
| try: | ||
| from _zstd import ZstdDecompressor as _zstd_decompressor_class | ||
| except Exception: |
Member
There was a problem hiding this comment.
What's the rationale of catching all exceptions here?
Member
Author
There was a problem hiding this comment.
matching the pattern of what the existing code did for zlib. realistically likely only an ImportError.
lkollar
pushed a commit
to lkollar/cpython
that referenced
this pull request
Sep 9, 2025
…pythonGH-138254) * pythongh-61206: support zstd in zipimport * NEWS entry * versionchanged doc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There's long been a request to support the alternate compression methods in
zipimport. zstandard makes sense as it can either be fast or high compression.While we "could"... It is probably not worth the effort to do the same for bz2 or lzma zip entries in
zipimport's implementation at this point.📚 Documentation preview 📚: https://cpython-previews--138254.org.readthedocs.build/