From: Victor Stinner Date: Mon, 9 May 2011 22:22:59 +0000 (+0200) Subject: (Merge 3.1) Issue #1195: Fix input() if it is interrupted by CTRL+d and then X-Git-Tag: v2.7.2rc1~50 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2c585f607e9164e4e416414010cbd09a6f361801;p=thirdparty%2FPython%2Fcpython.git (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. --- diff --git a/Misc/NEWS b/Misc/NEWS index 13778650c669..369d0a3360e7 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 8a76e0c23b4c..34fb45c93243 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