Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit db93278

Browse files
author
Victor Stinner
committed
Issue #1195: Fix input() if it is interrupted by CTRL+d and then CTRL+c, clear
the end-of-file indicator after CTRL+d.
2 parents 7254762 + 4755ab0 commit db93278

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ What's New in Python 3.2.1?
1010
Core and Builtins
1111
-----------------
1212

13+
- Issue #1195: Fix input() if it is interrupted by CTRL+d and then CTRL+c,
14+
clear the end-of-file indicator after CTRL+d.
15+
1316
- Issue #1856: Avoid crashes and lockups when daemon threads run while the
1417
interpreter is shutting down; instead, these threads are now killed when
1518
they try to take the GIL.

Parser/myreadline.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ my_fgets(char *buf, int len, FILE *fp)
7373
}
7474
#endif /* MS_WINDOWS */
7575
if (feof(fp)) {
76+
clearerr(fp);
7677
return -1; /* EOF */
7778
}
7879
#ifdef EINTR

0 commit comments

Comments
 (0)