[issue1195] Problems on Linux with Ctrl-D and Ctrl-C during raw_input

STINNER Victor report at bugs.python.org
Tue May 10 03:06:34 CEST 2011


STINNER Victor <victor.stinner at haypocalc.com> added the comment:

> The patch still does not handle the case where the eof indicator
> is already set when calling raw_input. My original patch does.

Correct, your example fails, but only in Python 2.7. I don't like the idea of always clearing errors. I prefer to reset stdin only after an error or EOF. Attached patch changes file.read() to clear the EOF flag if the read was stopped because of the EOF.

----------
Added file: http://bugs.python.org/file21949/clear_eof.patch

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


More information about the Python-bugs-list mailing list