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 r.david.murray
Recipients r.david.murray
Date 2009-02-19.21:36:07
SpamBayes Score 3.607121e-07
Marked as misclassified No
Message-id <1235079370.71.0.9273857922.issue5323@psf.upfronthosting.co.za>
In-reply-to
Content
The python 3.x io library appears to allow mixing calls to __next__ and
calls to readline.  As another consequence, where previously it was
necessary to use 'readline' to read single lines from a pipe without
blocking waiting for a buffer fill, now one can apparently use 'for'.

Reading the code in io.py, it seems as though this is intentional:
readline and __next__ use the same buffer, and the method on
TextIOWrapper that fills the buffer calls 'read1', which in the one
place where it has a docstring says that only as much data as is
available is read, in contrast to 'read', which reads exactly n bytes
(to EOF).

Assuming this is the intended behavior, it should be documented, and if
they do not exist (I didn't see any) tests should be added to confirm
the behavior.  If this behavior is an implementation artifact, then this
should be documented so that code is less likely to depend on it.

Once I know whether or not this behavior _should_ be part of the test
suite, I'll be happy to work on doc and test patches.
History
Date User Action Args
2009-02-19 21:36:10r.david.murraysetrecipients: + r.david.murray
2009-02-19 21:36:10r.david.murraysetmessageid: <1235079370.71.0.9273857922.issue5323@psf.upfronthosting.co.za>
2009-02-19 21:36:08r.david.murraylinkissue5323 messages
2009-02-19 21:36:07r.david.murraycreate