summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-05-10 00:22:59 +0200
committerVictor Stinner <victor.stinner@haypocalc.com>2011-05-10 00:22:59 +0200
commita5c3962c4b40d84039b9e48dbe82ed82712fde72 (patch)
treeafa9d2ab17bc364f51bd9af6a32f79682cf5ab03
parente3dc6fb9c89a5b998b4b97d61a20e6a72bcf3935 (diff)
downloadcpython-a5c3962c4b40d84039b9e48dbe82ed82712fde72.tar.gz
(Merge 3.1) Issue #1195: Fix input() if it is interrupted by CTRL+d and then
CTRL+c, clear the end-of-file indicator after CTRL+d.
-rw-r--r--Misc/NEWS3
-rw-r--r--Parser/myreadline.c1
2 files changed, 4 insertions, 0 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index 13778650c6..369d0a3360 100644
--- 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).
diff --git a/Parser/myreadline.c b/Parser/myreadline.c
index 8a76e0c23b..34fb45c932 100644
--- a/Parser/myreadline.c
+++ b/Parser/myreadline.c
@@ -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