[issue16350] zlib.Decompress.decompress() after EOF discards existing value of unused_data

Nadeem Vawda report at bugs.python.org
Mon Nov 5 01:31:40 CET 2012


Nadeem Vawda added the comment:

> flush() does not update unconsumed_tail and unused_data.
>
> >>> import zlib
> >>> x = zlib.compress(b'abcdefghijklmnopqrstuvwxyz') + b'0123456789'
> >>> dco = zlib.decompressobj()
> >>> dco.decompress(x, 1)
> b'a'
> >>> dco.flush()
> b'bcdefghijklmnopqrstuvwxyz'
> >>> dco.unconsumed_tail
> b'NIMK\xcf\xc8\xcc\xca\xce\xc9\xcd\xcb/(,*.)-+\xaf\xa8\xac\x02\x00\x90\x86\x0b 0123456789'
> >>> dco.unused_data
> b''

I see another bug here - described in issue 16411.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16350>
_______________________________________


More information about the Python-bugs-list mailing list