[issue8260] When I use codecs.open(...) and f.readline() follow up by f.read() return bad result

Daniel Diniz report at bugs.python.org
Wed Mar 31 08:12:23 CEST 2010


Daniel Diniz <ajaksu at gmail.com> added the comment:

Hi Stephane,

I think you're seeing different buffering behavior, which I suspect is correct according to docs.

codecs.open should default to line buffering[1], while open uses the system default[2].

The read() where the assert fails is returning the remaining buffer from the readline (which read 72 chars).

Asserting e.g. "f.read(1024) == ..." will give you the expected result.

[1] http://docs.python.org/library/codecs.html#codecs.open
[2] http://docs.python.org/library/functions.html#open

----------
nosy: +ajaksu2
priority:  -> normal
stage:  -> test needed

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


More information about the Python-bugs-list mailing list