mirror of https://github.com/python/cpython
gh-90839: Forward gzip.compress() compresslevel to zlib (gh-31215)
This commit is contained in:
parent
e44f988b26
commit
943ca5e1d6
|
@ -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)
|
||||
|
||||
|
||||
def decompress(data):
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Forward gzip.compress() compresslevel to zlib.
|
Loading…
Reference in New Issue