[proxy] bugs.python.org← back | site home | direct (HTTPS) ↗ | proxy home | ◑ dark◐ light

Message 162817 - Python tracker

Message162817

Author r.david.murray
Recipients docs@python, jaraco, r.david.murray, serhiy.storchaka, zach.ware
Date 2012-06-14.19:35:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1339702537.94.0.804791968316.issue15068@psf.upfronthosting.co.za>
In-reply-to
Content
That makes sense.  It is a consequence of (a) buffered input and (b) the fact that EOF on stdin doesn't really close it.  (And by interactive here I don't just mean Python's interactive prompt, but also the shell).

By default fileinput uses readlines with a buffer size, so it suffers from the same issue.  It is only the second time that you close stdin that it gets an empty buffer, and so terminates.

Anyone want to try to come up with a doc footnote to explain this?
History
Date User Action Args
2012-06-14 19:35:37r.david.murraysetrecipients: + r.david.murray, jaraco, docs@python, zach.ware, serhiy.storchaka
2012-06-14 19:35:37r.david.murraysetmessageid: <1339702537.94.0.804791968316.issue15068@psf.upfronthosting.co.za>
2012-06-14 19:35:37r.david.murraylinkissue15068 messages
2012-06-14 19:35:37r.david.murraycreate