Repository navigation
Conversation
Uses this API for all of our built-in stdlib based compressors. This allows additional compression methods to be officially supplied by third party libraries without monkeypatching the zipfile module. It is designed to obsolete the gross hacks that things like https://pypi.org/project/zipfile-zstd/ have to do.
Member
Author
|
Some further deep diving on the API design and use here is needed. This refactoring and dancing around the decompressor flush method and differing APIs between zlib and bzip2 and lzma was frustratingly informative. #67389 should be considered and perhaps don't require a |
Member
Author
|
chatted with @emmatyping at the pycon US sprint today, she's going to take this on. |
|
This PR is stale because it has been open for 30 days with no activity. |
Member
Author
|
while the concept is still useful, we've gained |
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.
This refactors
zipfileto add aregister_compression()API and uses the API for all of our built-in stdlib based compressors (zlib's deflate, bz2, and lzma).This allows additional compression methods to be officially supplied by third party libraries without monkeypatching the zipfile module. It is designed to obsolete the gross hacks that things like https://pypi.org/project/zipfile-zstd/ have to do.
Motivation: zstandard support in zipfile, without adding a zstandard implementation to the standard library and without using monkeypatching. But I'm sure others will find it useful as well. Another potential use case is enabling the use of optimized compressors (think parallelized zlib's like pigz) instead of the stdlib default implementations.
TODO items:
zipfile.register_compressiondocstring for now).