summaryrefslogtreecommitdiffstats
path: root/Modules/_io/fileio.c
diff options
context:
space:
mode:
authorGregory P. Smith <greg@krypto.org>2012-06-24 07:23:47 (GMT)
committerGregory P. Smith <greg@krypto.org>2012-06-24 07:23:47 (GMT)
commit990a5feba77de7fc5fd5ad5a16f61dc93667f63e (patch)
treeb0fdb65c20e4a233f59a60c4aa2081949a9cf441 /Modules/_io/fileio.c
parent80d440aee198abc4077f7c30ecbf0a14e42c6eea (diff)
parent5135992164f4c0df8d18d3b486431b28214db16b (diff)
downloadcpython-990a5feba77de7fc5fd5ad5a16f61dc93667f63e.zip
cpython-990a5feba77de7fc5fd5ad5a16f61dc93667f63e.tar.gz
cpython-990a5feba77de7fc5fd5ad5a16f61dc93667f63e.tar.bz2
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.
Diffstat (limited to 'Modules/_io/fileio.c')
-rw-r--r--Modules/_io/fileio.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/Modules/_io/fileio.c b/Modules/_io/fileio.c
index 226a5d2..198392f 100644
--- a/Modules/_io/fileio.c
+++ b/Modules/_io/fileio.c
@@ -670,6 +670,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) {