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

STINNER Victor report at bugs.python.org
Fri Mar 18 10:58:16 CET 2011


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

Instead of always calling clearerr(), we can only call it on EOF:

diff -r 88fe1ac48460 Parser/myreadline.c
--- a/Parser/myreadline.c       Mon Mar 07 08:31:52 2011 +0100
+++ b/Parser/myreadline.c       Fri Mar 18 10:57:23 2011 +0100
@@ -72,6 +72,7 @@
     }
 #endif /* MS_WINDOWS */
     if (feof(fp)) {
+        clearerr(fp);
         return -1; /* EOF */
     }
 #ifdef EINTR

This patch works around this issue.

----------

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


More information about the Python-bugs-list mailing list