[issue15955] gzip, bz2, lzma: add option to limit output size

Nikolaus Rath report at bugs.python.org
Sat Jan 25 19:46:13 CET 2014


Nikolaus Rath added the comment:

Let me be more precise: 

My suggestion is not to remove `unconsumed_tail` entirely, but I think its value needs to be defined only when the end of the compressed stream has been reached.

In other words, you could still do:

while not decomp.eof
  # ...
if decomp.unconsumed_tail:
    raise RuntimeError('unexpected data after end of compressed stream')

but as long as decomp.eof is True, decomp.unconsumed_tail could (as far as I can tell) be None, no matter if there is uncompressed data in the internal buffer or not.

----------

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


More information about the Python-bugs-list mailing list