The behavior contradicts documentation and is inconsistent with both cStringIO and File objects. Patch attached. >>> StringIO.StringIO('foo').readline(0) 'foo' >>> cStringIO.StringIO('foo').readline(0) '' >>> open('/etc/passwd').readline(0) ''
Oops, I was too quick with that nosy. This bug is fixed in io.StringIO, which means it is fixed in Python3. And sorry to say, it shouldn't be fixed in a maintenance release, since it is a behavior change that could break working programs.
History
Date
User
Action
Args
2022-04-11 14:57:51
admin
set
github: 63414
2013-10-10 11:44:12
r.david.murray
set
status: open -> closednosy: + r.david.murraymessages: + resolution: out of datestage: resolved