summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-07-02 21:00:38 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2014-07-02 21:00:38 (GMT)
commit6680e9f5fd1015ec7630c7658b5fdcce93114ab4 (patch)
treea594b6d2cf782e4d8a2925684866bf10034f5735
parent7c45632f6dc442168d68810821e921ee1fe7f5b4 (diff)
parente10920f0d1009ea33ce4b35b015a928b33a80867 (diff)
downloadcpython-6680e9f5fd1015ec7630c7658b5fdcce93114ab4.zip
cpython-6680e9f5fd1015ec7630c7658b5fdcce93114ab4.tar.gz
cpython-6680e9f5fd1015ec7630c7658b5fdcce93114ab4.tar.bz2
(Merge 3.4) Issue #21090: io.FileIO.readall() does not ignore I/O errors
anymore. Before, it ignored I/O errors if at least the first C call read() succeed.
-rw-r--r--Misc/NEWS3
-rw-r--r--Modules/_io/fileio.c4
2 files changed, 5 insertions, 2 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index 0428775..b7c7b9b 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -103,6 +103,9 @@ Core and Builtins
Library
-------
+- Issue #21090: io.FileIO.readall() does not ignore I/O errors anymore. Before,
+ it ignored I/O errors if at least the first C call read() succeed.
+
- Issue #5800: headers parameter of wsgiref.headers.Headers is now optional.
Initial patch by Pablo Torres Navarrete and SilentGhost.
diff --git a/Modules/_io/fileio.c b/Modules/_io/fileio.c
index 038b2c6..280523b 100644
--- a/Modules/_io/fileio.c
+++ b/Modules/_io/fileio.c
@@ -694,9 +694,9 @@ fileio_readall(fileio *self)
}
continue;
}
- if (bytes_read > 0)
- break;
if (errno == EAGAIN) {
+ if (bytes_read > 0)
+ break;
Py_DECREF(result);
Py_RETURN_NONE;
}