mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Fixes issue #12268: File readline, readlines and read() or readall() methods
no longer lose data when an underlying read system call is interrupted. IOError is no longer raised due to a read system call returning EINTR from within these methods.
This commit is contained in:
parent
8150492f11
commit
5135992164
7 changed files with 290 additions and 8 deletions
|
@ -605,6 +605,13 @@ fileio_readall(fileio *self)
|
|||
if (n == 0)
|
||||
break;
|
||||
if (n < 0) {
|
||||
if (errno == EINTR) {
|
||||
if (PyErr_CheckSignals()) {
|
||||
Py_DECREF(result);
|
||||
return NULL;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (total > 0)
|
||||
break;
|
||||
if (errno == EAGAIN) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue