[issue6467] raw_input() doesn't work as expected when it gets multiple ^D

Nick Coghlan report at bugs.python.org
Sat Jul 18 00:39:43 CEST 2009

Nick Coghlan <ncoghlan at gmail.com> added the comment:

Confirmed - it's actually pressing "Ctrl-D" after entering text on the
line that seems to cause strange behaviour. For example, in the
following, the only letters I typed were "test" and then I just pressed
"Ctrl-D" 4 times and got the output seen below:

$ ./python raw_input_test.py
Traceback (most recent call last):
  File "raw_input_test.py", line 3, in <module>
    c = raw_input()

The "test" appeared as typed, the "tes\n" appeared after pressing Ctrl-D
three times, then the 4th Ctrl-D on its own line correctly triggered

(This with 2.7a0 on Ubuntu 8.04)

nosy: +ncoghlan

Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list