mirror of
https://github.com/python/cpython.git
synced 2025-07-23 11:15:24 +00:00
Additional fix for Issue #12268: The io module file object writelines() methods no longer abort early when one of its write system calls is interrupted (EINTR).
This commit is contained in:
parent
b47acbf46a
commit
b9817b01ed
3 changed files with 12 additions and 3 deletions
|
@ -817,6 +817,9 @@ Library
|
||||||
Extension Modules
|
Extension Modules
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
|
- Issue #12268: The io module file object writelines() methods no longer
|
||||||
|
abort early when one of its write system calls is interrupted (EINTR).
|
||||||
|
|
||||||
- Fix the leak of a dict in the time module when used in an embedded
|
- Fix the leak of a dict in the time module when used in an embedded
|
||||||
interpreter that is repeatedly initialized and shutdown and reinitialized.
|
interpreter that is repeatedly initialized and shutdown and reinitialized.
|
||||||
|
|
||||||
|
|
|
@ -674,7 +674,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);
|
||||||
|
|
|
@ -1249,8 +1249,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;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue