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.

classification
Title: Misleading compress level header on files created with gzip
Type: behavior Stage: resolved
Components: Extension Modules Versions: Python 3.6, Python 3.5, Python 2.7
process
Status: closed Resolution: duplicate
Dependencies: Superseder: gzip metadata fails to reflect compresslevel
View: 39389
Assigned To: Nosy List: ddorda, iritkatriel, r.david.murray
Priority: normal Keywords: patch

Created on 2016-07-15 17:26 by ddorda, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
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 (4)
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 :)
msg391772 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-04-24 10:50
I believe this was fixed here: https://github.com/python/cpython/pull/18077
History
Date User Action Args
2022-04-11 14:58:33adminsetgithub: 71708
2021-05-26 13:34:27iritkatrielsetstatus: pending -> closed
stage: test needed -> resolved
2021-04-24 10:50:25iritkatrielsetstatus: open -> pending

nosy: + iritkatriel
messages: + msg391772

superseder: gzip metadata fails to reflect compresslevel
resolution: duplicate
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