New submission from Ilya Leoshkevich <i...@linux.ibm.com>: Started with:
commit ea23e7820f02840368569db8082bd0ca4d59b62a Author: Ruben Vorderman <r.h.p.vorder...@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 <luk...@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. ---------- components: Library (Lib) messages: 412843 nosy: iii-i priority: normal severity: normal status: open title: gzip.compress does not forward compresslevel to zlib.compress type: behavior versions: Python 3.11 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue46681> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com