Issue 19215: StringIO.StringIO('foo').readline(0) == 'foo' (original) (raw)

Issue19215

Created on 2013-10-10 09:57 by Zdeněk.Pavlas, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
stringio.patch Zdeněk.Pavlas,2013-10-10 09:57
Messages (2)
msg199376 - (view) Author: Zdeněk Pavlas (Zdeněk.Pavlas) Date: 2013-10-10 09:57
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) ''
msg199382 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2013-10-10 11:44
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
2013-10-10 11:40:48 r.david.murray set nosy: + pitrou
2013-10-10 09:57:59 Zdeněk.Pavlas create