]> granicus.if.org Git - python/commitdiff
(Merge 3.1) Issue #1195: Fix input() if it is interrupted by CTRL+d and then
authorVictor Stinner <victor.stinner@haypocalc.com>
Mon, 9 May 2011 22:22:59 +0000 (00:22 +0200)
committerVictor Stinner <victor.stinner@haypocalc.com>
Mon, 9 May 2011 22:22:59 +0000 (00:22 +0200)
CTRL+c, clear the end-of-file indicator after CTRL+d.

Misc/NEWS
Parser/myreadline.c

index 13778650c669ef667c11e6a80b7bb2659b52ce76..369d0a3360e79a01ae02289466628b96b7253a9f 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -9,6 +9,9 @@ What's New in Python 2.7.2?
 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 #8651: PyArg_Parse*() functions raise an OverflowError if the file
   doesn't have PY_SSIZE_T_CLEAN define and the size doesn't fit in an int
   (length bigger than 2^31-1 bytes).
index 8a76e0c23b4cc889d93b25baa841dfaeb2558121..34fb45c93243d6b72342ba9da57c76e530140e6c 100644 (file)
@@ -77,6 +77,7 @@ my_fgets(char *buf, int len, FILE *fp)
         }
 #endif /* MS_WINDOWS */
         if (feof(fp)) {
+            clearerr(fp);
             return -1; /* EOF */
         }
 #ifdef EINTR