(original) (raw)
changeset: 70536:deb6e7859211 parent: 70533:4b6e76d3b1fa parent: 70535:de07f90ef45c user: Victor Stinner victor.stinner@haypocalc.com date: Mon May 30 23:47:01 2011 +0200 files: Misc/NEWS description: (Merge 3.2) Issue #12016: my_fgets() now always clears errors before calling fgets(). Fix the following case: sys.stdin.read() stopped with CTRL+d (end of file), raw_input() interrupted by CTRL+c. diff -r 4b6e76d3b1fa -r deb6e7859211 Misc/NEWS --- a/Misc/NEWS Mon May 30 23:26:51 2011 +0200 +++ b/Misc/NEWS Mon May 30 23:47:01 2011 +0200 @@ -10,6 +10,10 @@ Core and Builtins ----------------- +- Issue #12016: my_fgets() now always clears errors before calling fgets(). Fix + the following case: sys.stdin.read() stopped with CTRL+d (end of file), + raw_input() interrupted by CTRL+c. + - Issue #12216: Allow unexpected EOF errors to happen on any line of the file. - Issue #12199: The TryExcept and TryFinally and AST nodes have been unified diff -r 4b6e76d3b1fa -r deb6e7859211 Parser/myreadline.c --- a/Parser/myreadline.c Mon May 30 23:26:51 2011 +0200 +++ b/Parser/myreadline.c Mon May 30 23:47:01 2011 +0200 @@ -40,6 +40,7 @@ if (PyOS_InputHook != NULL) (void)(PyOS_InputHook)(); errno = 0; + clearerr(fp); p = fgets(buf, len, fp); if (p != NULL) return 0; /* No error */ /victor.stinner@haypocalc.com