[New-bugs-announce] [issue43612] zlib.compress should have a wbits argument

Ruben Vorderman report at bugs.python.org
Wed Mar 24 02:04:20 EDT 2021


New submission from Ruben Vorderman <r.h.p.vorderman at lumc.nl>:

zlib.compress can now only be used to output zlib blocks.
Arguably `zlib.compress(my_data, level, wbits=-15)` is even more useful as it gives you a raw deflate block. That is quite interesting if you are writing your own file format and want to use compression, but like to use a different hash.

Also gzip.compress(data, level, mtime) is extremely slow due to it instantiating a GzipFile object which then streams a bytes object. Explicitly not taking advantage of the fact that the bytes object is entirely in memory already (I will create another bug for this). zlib.compress(my_data, level, wbits=31) should be faster in all possible circumstances, but that option is not available now.

----------
components: Library (Lib)
messages: 389437
nosy: rhpvorderman
priority: normal
severity: normal
status: open
title: zlib.compress should have a wbits argument
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43612>
_______________________________________


More information about the New-bugs-announce mailing list