Commit 99ec7f6f authored by Gregory P. Smith's avatar Gregory P. Smith

Additional fix for issue #12268: The io module file object write methods no

longer abort early when a write system call is interrupted (EINTR).
parents 193e1be7 b9817b01
...@@ -506,6 +506,12 @@ Library ...@@ -506,6 +506,12 @@ Library
- Issue #15906: Fix a regression in `argparse` caused by the preceding change, - Issue #15906: Fix a regression in `argparse` caused by the preceding change,
when ``action='append'``, ``type='str'`` and ``default=[]``. when ``action='append'``, ``type='str'`` and ``default=[]``.
Extension Modules
-----------------
- Issue #12268: The io module file object write methods no longer abort early
when one of its write system calls is interrupted (EINTR).
Tests Tests
----- -----
......
...@@ -669,7 +669,10 @@ iobase_writelines(PyObject *self, PyObject *args) ...@@ -669,7 +669,10 @@ iobase_writelines(PyObject *self, PyObject *args)
break; /* Stop Iteration */ break; /* Stop Iteration */
} }
res = PyObject_CallMethodObjArgs(self, _PyIO_str_write, line, NULL); res = NULL;
do {
res = PyObject_CallMethodObjArgs(self, _PyIO_str_write, line, NULL);
} while (res == NULL && _PyIO_trap_eintr());
Py_DECREF(line); Py_DECREF(line);
if (res == NULL) { if (res == NULL) {
Py_DECREF(iter); Py_DECREF(iter);
......
...@@ -1247,8 +1247,11 @@ _textiowrapper_writeflush(textio *self) ...@@ -1247,8 +1247,11 @@ _textiowrapper_writeflush(textio *self)
Py_DECREF(pending); Py_DECREF(pending);
if (b == NULL) if (b == NULL)
return -1; return -1;
ret = PyObject_CallMethodObjArgs(self->buffer, ret = NULL;
_PyIO_str_write, b, NULL); do {
ret = PyObject_CallMethodObjArgs(self->buffer,
_PyIO_str_write, b, NULL);
} while (ret == NULL && _PyIO_trap_eintr());
Py_DECREF(b); Py_DECREF(b);
if (ret == NULL) if (ret == NULL)
return -1; return -1;
......
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