classification
Title: zipfile ignores deflate level settings in zipinfo object
Type: enhancement Stage: needs patch
Components: Library (Lib) Versions: Python 3.5
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: alanmcintyre, bbayles, docs@python, jens, rmilne, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2013-12-05 09:26 by rmilne, last changed 2018-02-25 23:28 by bbayles.

Files
File name Uploaded Description Edit
zipfileinfo.diff rmilne, 2013-12-05 09:26 Docs, tests and module patch against current tip of 2.7 branch (ae9fb85ab4e0 ?) review
Messages (4)
msg205284 - (view) Author: Richard Milne (rmilne) Date: 2013-12-05 09:26
Reading the pkzip APPNOTE and the documentation for the zipfile module, I was under the impression that I could set the DEFLATE compression level, on a per-file basis, for each file added to an archive, by setting the appropriate bits in zipinfo.flag_bits.

You can't. Hence the attached patch, which updates the docs, tests and module source to enables this ability and makes the user aware of it.
msg206414 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2013-12-17 08:30
This is new feature and can be added only in 3.5.
msg245747 - (view) Author: Jens Diemer (jens) Date: 2015-06-24 14:52
IMHO it should be possible to set compression level not only for DEFLATE.
And it should be similar with the tarfile API.

Seems that http://bugs.python.org/issue21417 will cover this.
msg312869 - (view) Author: bbayles (bbayles) * Date: 2018-02-25 23:28
This was fixed in issue 21417, in Github PR 5385:

https://github.com/python/cpython/pull/5385
History
Date User Action Args
2018-02-25 23:28:20bbaylessetnosy: + bbayles
messages: + msg312869
2015-06-24 14:52:32jenssetnosy: + jens
messages: + msg245747
2013-12-17 08:30:45serhiy.storchakasetversions: + Python 3.5, - Python 2.7
messages: + msg206414

assignee: docs@python ->
components: - Documentation, Tests
type: behavior -> enhancement
stage: patch review -> needs patch
2013-12-05 13:08:31serhiy.storchakasetnosy: + alanmcintyre, serhiy.storchaka

stage: patch review
2013-12-05 09:26:49rmilnecreate