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 iii-i
Recipients iii-i
Date 2022-02-08.14:52:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1644331972.38.0.86974192008.issue46681@roundup.psfhosted.org>
In-reply-to
Content
Started with:

commit ea23e7820f02840368569db8082bd0ca4d59b62a
Author: Ruben Vorderman <r.h.p.vorderman@lumc.nl>
Date:   Thu Sep 2 17:02:59 2021 +0200

    bpo-43613: Faster implementation of gzip.compress and gzip.decompress (GH-27941)
    
    Co-authored-by: Łukasz Langa <lukasz@langa.pl>

The fix is quite trivial:

--- a/Lib/gzip.py
+++ b/Lib/gzip.py
@@ -587,7 +587,8 @@ def compress(data, compresslevel=_COMPRESS_LEVEL_BEST, *, mtime=None):
     header = _create_simple_gzip_header(compresslevel, mtime)
     trailer = struct.pack("<LL", zlib.crc32(data), (len(data) & 0xffffffff))
     # Wbits=-15 creates a raw deflate block.
-    return header + zlib.compress(data, wbits=-15) + trailer
+    return (header + zlib.compress(data, level=compresslevel, wbits=-15) +
+            trailer)

I'll send a PR.
History
Date User Action Args
2022-02-08 14:52:52iii-isetrecipients: + iii-i
2022-02-08 14:52:52iii-isetmessageid: <1644331972.38.0.86974192008.issue46681@roundup.psfhosted.org>
2022-02-08 14:52:52iii-ilinkissue46681 messages
2022-02-08 14:52:52iii-icreate