(original) (raw)

changeset: 70535:de07f90ef45c branch: 3.2 parent: 70506:85f4b38a61fa user: Victor Stinner victor.stinner@haypocalc.com date: Mon May 30 23:46:00 2011 +0200 files: Misc/NEWS Parser/myreadline.c description: 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 85f4b38a61fa -r de07f90ef45c Misc/NEWS --- a/Misc/NEWS Sun May 29 16:43:52 2011 -0500 +++ b/Misc/NEWS Mon May 30 23:46:00 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 #9670: Increase the default stack size for secondary threads on Mac OS X and FreeBSD to reduce the chances of a crash instead of a "maximum recursion depth" RuntimeError exception. diff -r 85f4b38a61fa -r de07f90ef45c Parser/myreadline.c --- a/Parser/myreadline.c Sun May 29 16:43:52 2011 -0500 +++ b/Parser/myreadline.c Mon May 30 23:46:00 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