R. David Murray <rdmur...@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@python components: +Documentation nosy: +docs@python _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue15068> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com