[issue15546] Iteration breaks with bz2.open(filename,'rt')

Antoine Pitrou report at bugs.python.org
Sat Aug 4 00:29:48 CEST 2012


Antoine Pitrou added the comment:

> I propose amending BZ2File.read1() to make as many reads
> from the underlying file as necessary to return a non-empty result.

Agreed. IMO, read1()'s contract should be read as a best-effort thing, not an absolute guarantee. Returning an empty string when there is still data available is wrong.

----------

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


More information about the Python-bugs-list mailing list