[docs] [issue15068] fileinput requires two EOF when reading stdin

R. David Murray report at bugs.python.org
Thu Jun 14 21:35:37 CEST 2012


R. David Murray <rdmurray at bitdance.com> added the comment:

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?

----------
assignee:  -> docs at python
components: +Documentation
nosy: +docs at python

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15068>
_______________________________________


More information about the docs mailing list