Commit e654c11f authored by Martin v. Löwis's avatar Martin v. Löwis

Issue #14433: Prevent msvcrt crash in interactive prompt when stdin is closed.

parent b8f02b5a
......@@ -10,6 +10,9 @@ What's New in Python 3.2.4
Core and Builtins
-----------------
- Issue #14433: Prevent msvcrt crash in interactive prompt when stdin
is closed.
- Issue #11603 (again): Setting __repr__ to __str__ now raises a RuntimeError
when repr() or str() is called on such an object.
......
......@@ -42,7 +42,10 @@ my_fgets(char *buf, int len, FILE *fp)
(void)(PyOS_InputHook)();
errno = 0;
clearerr(fp);
p = fgets(buf, len, fp);
if (_PyVerify_fd(fileno(fp)))
p = fgets(buf, len, fp);
else
p = NULL;
if (p != NULL)
return 0; /* No error */
err = errno;
......
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