Commit 693fd9f6 authored by Victor Stinner's avatar Victor Stinner

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.
parent 801f4910
Python News
+++++++++++
What's New in Python 2.7.3?
===========================
*Release date: XXXX-XX-XX*
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.
Library
-------
What's New in Python 2.7.2?
===========================
......
......@@ -44,6 +44,7 @@ my_fgets(char *buf, int len, FILE *fp)
if (PyOS_InputHook != NULL)
(void)(PyOS_InputHook)();
errno = 0;
clearerr(fp);
p = fgets(buf, len, fp);
if (p != NULL)
return 0; /* No error */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment