[New-bugs-announce] [issue15068] fileinput requires two EOF when reading stdin

Jason R. Coombs report at bugs.python.org
Thu Jun 14 17:19:34 CEST 2012


New submission from Jason R. Coombs <jaraco at jaraco.com>:

I found that fileinput.input() requires two EOF characters to stop reading input on Python 2.7.3 on Windows and Ubuntu:

PS C:\Users\jaraco> python
Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)] on win32
>>> import fileinput
>>> lines = list(fileinput.input())
foo
bar
^Z
^Z
>>> lines
['foo\n', 'bar\n']

I don't see anything in the documentation that suggests that two EOF characters would be required, and I can't think of any reason why that should be the case.

----------
components: Library (Lib)
messages: 162798
nosy: jason.coombs
priority: normal
severity: normal
status: open
title: fileinput requires two EOF when reading stdin
versions: Python 2.7

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


More information about the New-bugs-announce mailing list