[Python-checkins] cpython (merge 3.2 -> default): Merge with 3.2: issue #14433
martin.v.loewis
python-checkins at python.org
Mon Apr 30 06:28:44 CEST 2012
http://hg.python.org/cpython/rev/2c27093fd11f
changeset: 76661:2c27093fd11f
parent: 76659:7319430a291d
parent: 76660:2de5e9715fe9
user: Martin v. Löwis <martin at v.loewis.de>
date: Mon Apr 30 06:20:37 2012 +0200
summary:
Merge with 3.2: issue #14433
files:
Misc/NEWS | 3 +++
Parser/myreadline.c | 5 ++++-
2 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -10,6 +10,9 @@
Core and Builtins
-----------------
+- Issue #14433: Prevent msvcrt crash in interactive prompt when stdin
+ is closed.
+
- Issue #14521: Make result of float('nan') and float('-nan') more
consistent across platforms.
diff --git a/Parser/myreadline.c b/Parser/myreadline.c
--- a/Parser/myreadline.c
+++ b/Parser/myreadline.c
@@ -42,7 +42,10 @@
(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;
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list