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

Nadeem Vawda report at bugs.python.org
Mon Nov 5 00:58:58 CET 2012


Nadeem Vawda added the comment:

Fixed. Thanks for the patch!


> This hacking is not needed, if first argument of PyBytes_FromStringAndSize()
> is NULL, the contents of the bytes object are uninitialized.

Oh, cool. I didn't know about that.


> What should unconsumed_tail be equal after EOF? b'' or unused_data?

Definitely b''. unconsumed_tail is meant to hold compressed data that should
be passed in to the next call to decompress(). If we are at EOF, then
decompress() should not be called again, and so it would be misleading to have
unconsumed_tail be non-empty.

----------
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

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


More information about the Python-bugs-list mailing list