(EINTR), for example if the program is stopped with CTRL+z on Mac OS X. Patch
written by Charles-Francois Natali.
Core and Builtins
-----------------
+- Issue #11650: PyOS_StdioReadline() retries fgets() if it was interrupted
+ (EINTR), for example if the program is stopped with CTRL+z on Mac OS X. Patch
+ written by Charles-Francois Natali.
+
- Issue #8651: PyArg_Parse*() functions raise an OverflowError if the file
doesn't have PY_SSIZE_T_CLEAN define and the size doesn't fit in an int
(length bigger than 2^31-1 bytes).
my_fgets(char *buf, int len, FILE *fp)
{
char *p;
- for (;;) {
+ while (1) {
if (PyOS_InputHook != NULL)
(void)(PyOS_InputHook)();
errno = 0;
#ifdef WITH_THREAD
PyEval_SaveThread();
#endif
- if (s < 0) {
- return 1;
- }
+ if (s < 0)
+ return 1;
+ /* try again */
+ continue;
}
#endif
if (PyOS_InterruptOccurred()) {