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:
Gregory P. Smith 2012-06-23 23:55:39 -07:00
parent 8150492f11
commit 5135992164
7 changed files with 290 additions and 8 deletions

View file

@ -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) {