[pypy-issue] [issue1299] BZ2Decompressor.decompress('') does not raise EOFError at end-of-stream

Nadeem Vawda tracker at bugs.pypy.org
Sun Oct 21 17:58:13 CEST 2012


New submission from Nadeem Vawda <nadeem.vawda at gmail.com>:

In CPython, the BZ2Decompressor.decompress method raises EOFError if the end of 
the compressed stream has been reached. This can be useful, as it allows the 
caller to determine whether end-of-stream has been reached without affecting the 
decompressor's internal state. However, in PyPy 1.9, no exception is raised if 
the input data is of length 0, so this trick cannot be used.

The attached patch changes PyPy's behavior in this case to match CPython.

----------
files: bz2-decompress-eof.diff
messages: 4885
nosy: nadeem.vawda, pypy-issue
priority: bug
release: 2.0
status: unread
title: BZ2Decompressor.decompress('') does not raise EOFError at end-of-stream

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue1299>
________________________________________


More information about the pypy-issue mailing list