diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2012-04-30 04:20:37 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2012-04-30 04:20:37 (GMT) |
commit | ce58ed3e7c6ee794b3b1d5aae86c5116da9efe3d (patch) | |
tree | 8e8b46409b8e2809957514a0339c199f06d87bd0 | |
parent | 0e8ccb83046e78a76f5bc55412761d208644db7c (diff) | |
parent | e654c11f565d1be32062931dc0a1817004b7387b (diff) | |
download | cpython-ce58ed3e7c6ee794b3b1d5aae86c5116da9efe3d.zip cpython-ce58ed3e7c6ee794b3b1d5aae86c5116da9efe3d.tar.gz cpython-ce58ed3e7c6ee794b3b1d5aae86c5116da9efe3d.tar.bz2 |
Merge with 3.2: issue #14433
-rw-r--r-- | Misc/NEWS | 3 | ||||
-rw-r--r-- | Parser/myreadline.c | 5 |
2 files changed, 7 insertions, 1 deletions
@@ -10,6 +10,9 @@ What's New in Python 3.3.0 Alpha 3? 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 index 33d5b3d..cb1cf0f 100644 --- a/Parser/myreadline.c +++ b/Parser/myreadline.c @@ -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; |