[issue14475] codecs.StreamReader.read behaves differently from regular files

Andrew report at bugs.python.org
Thu May 17 01:37:34 CEST 2012


Andrew <andrew at learnirvana.com> added the comment:

Just got this behavior, with readlines(), which is unsurprising since it internally uses read() as described in the original bug report.

The break on line 468 of codecs.py seems to be the problem, it fixes it if I remove this conditional locally.

http://hg.python.org/cpython/file/f6a207d86154/Lib/codecs.py#l466

I may be overlooking something, but I would assume this should be checking if the character buffer extends to the EOF of the underlaying stream at this point?

As stated before can be reproduced by:
f = codecs.open(...)
f.read()
f.readlines()

----------
nosy: +Andrew.S

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


More information about the Python-bugs-list mailing list