[issue5863] bz2.BZ2File should accept other file-like objects. (issue4274045)

Nadeem Vawda report at bugs.python.org
Mon Mar 21 02:15:47 CET 2011


Nadeem Vawda <nadeem.vawda at gmail.com> added the comment:

Here is an updated patch, incorporating the feedback from your review.

The new patch no longer checks for errors in bz2CompressEnd()/bz2DecompressEnd()
in the dealloc functions for BZ2Compressor/BZ2Decompressor. I found that calling
PyErr_WriteUnraisable() results in spurious error messages if an exception is
raised by the init function, and in any case, the output would not be of much
use if a genuine error were to occur.

The patch adds implementations of most of the io.BufferedIOBase methods
(everything except detach(), read1() and truncate()), and includes unit tests
for fileno() and readinto().

----------
Added file: http://bugs.python.org/file21314/bz2-v4.diff

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


More information about the Python-bugs-list mailing list