Message162817
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? |
|
Date |
User |
Action |
Args |
2012-06-14 19:35:37 | r.david.murray | set | recipients:
+ r.david.murray, jaraco, docs@python, zach.ware, serhiy.storchaka |
2012-06-14 19:35:37 | r.david.murray | set | messageid: <1339702537.94.0.804791968316.issue15068@psf.upfronthosting.co.za> |
2012-06-14 19:35:37 | r.david.murray | link | issue15068 messages |
2012-06-14 19:35:37 | r.david.murray | create | |
|