changeset 69994:b5914bfb4d04 3.2

Issue #1195: Fix input() if it is interrupted by CTRL+d and then CTRL+c, clear the end-of-file indicator after CTRL+d. [#1195]
author Victor Stinner <victor.stinner@haypocalc.com>
date Tue, 10 May 2011 00:20:35 +0200
parents 62e2b74c3bfc (current diff) fa3227c3cf87 (diff)
children 3ff5d28ab630 20beec22764f
files Misc/NEWS Parser/myreadline.c
diffstat 2 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -10,6 +10,9 @@ What's New in Python 3.2.1?
 Core and Builtins
 -----------------
 
+- Issue #1195: Fix input() if it is interrupted by CTRL+d and then CTRL+c,
+  clear the end-of-file indicator after CTRL+d.
+
 - Issue #1856: Avoid crashes and lockups when daemon threads run while the
   interpreter is shutting down; instead, these threads are now killed when
   they try to take the GIL.
--- a/Parser/myreadline.c
+++ b/Parser/myreadline.c
@@ -73,6 +73,7 @@ my_fgets(char *buf, int len, FILE *fp)
         }
 #endif /* MS_WINDOWS */
         if (feof(fp)) {
+            clearerr(fp);
             return -1; /* EOF */
         }
 #ifdef EINTR