This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author scop
Recipients scop
Date 2011-02-24.21:32:21
SpamBayes Score 3.2445657e-09
Marked as misclassified No
Message-id <1298583142.96.0.124636829869.issue11311@psf.upfronthosting.co.za>
In-reply-to
Content
Python 2.7 (r27:82500, Sep 16 2010, 18:02:00) 
[GCC 4.5.1 20100907 (Red Hat 4.5.1-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import StringIO
>>> StringIO.StringIO("foo").readline(0)
'foo'

I don't think this is the correct behavior, or at least it is not consistent with other file objects' readline() which return an empty string with .readline(0).

For example:

>>> import cStringIO
>>> cStringIO.StringIO("foo").readline(0)
''

...or:

>>> file("/usr/bin/python").readline(0)
''
History
Date User Action Args
2011-02-24 21:32:23scopsetrecipients: + scop
2011-02-24 21:32:22scopsetmessageid: <1298583142.96.0.124636829869.issue11311@psf.upfronthosting.co.za>
2011-02-24 21:32:21scoplinkissue11311 messages
2011-02-24 21:32:21scopcreate