Title: Misleading compress level header on files created with gzip
Type: behavior Stage: test needed
Components: Extension Modules Versions: Python 3.6, Python 3.5, Python 2.7
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: ddorda, r.david.murray
Priority: normal Keywords: patch

Created on 2016-07-15 17:26 by ddorda, last changed 2016-07-15 19:30 by ddorda.

File name Uploaded Description Edit
gzip_compressionlvl_header_fix.patch ddorda, 2016-07-15 17:26 Compress level fix patch review
compress_level_tests.patch ddorda, 2016-07-15 19:30 Tests for patch review
Messages (3)
msg270490 - (view) Author: Dor Dankner (ddorda) * Date: 2016-07-15 17:26
When creating a gzip file using the gzip module,
the wrong header is set as the compress level when not using the default (9).
the reason is that the header is set blindly as \002, without really checking what compress level is.

Patch to fix that behaviour is provided :)
(Patch tested on python 3.5, but relevant to 2.x versions too)
msg270496 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2016-07-15 18:11
Thanks for the report and patch.  Now we need a test.
msg270504 - (view) Author: Dor Dankner (ddorda) * Date: 2016-07-15 19:30
Thank you for the fast reponse!
tests patch for the proposal fix is attached :)
Date User Action Args
2016-07-15 19:30:35ddordasetfiles: + compress_level_tests.patch

messages: + msg270504
2016-07-15 18:11:47r.david.murraysetversions: - Python 3.2, Python 3.3, Python 3.4
nosy: + r.david.murray

messages: + msg270496

stage: test needed
2016-07-15 17:26:50ddordacreate