This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author bbayles
Recipients bbayles
Date 2018-01-30.16:47:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1517330840.6.0.467229070634.issue32728@psf.upfronthosting.co.za>
In-reply-to
Content
In [1] (issue 21417), support for setting an archive (or its files) compression level was added to the zipfile module.

That currently works for the ZIP_DEFLATED and ZIP_BZIP2 compression methods, but not for ZIP_LZMA. This is because zipfile includes its own implementation of LZMACompressor that hard-codes the default preset's parameters (see also [2]).

It should be possible to extend compression level settings to ZIP_LZMA by making zipfile.LZMACompressor more flexible, i.e. able to accept an LZMA preset. I think this would involve porting the function that translates presets to options (lzma_lzma_preset, see [3]) and passing in those options to lzma.LZMACompressor .

[1] https://bugs.python.org/issue21417
[2] https://github.com/python/cpython/pull/5385
[3] https://git.tukaani.org/?p=xz.git;a=blob;f=src/liblzma/lzma/lzma_encoder_presets.c;hb=HEAD
History
Date User Action Args
2018-01-30 16:47:20bbaylessetrecipients: + bbayles
2018-01-30 16:47:20bbaylessetmessageid: <1517330840.6.0.467229070634.issue32728@psf.upfronthosting.co.za>
2018-01-30 16:47:20bbayleslinkissue32728 messages
2018-01-30 16:47:20bbaylescreate