summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-07-02 21:12:48 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2014-07-02 21:12:48 (GMT)
commitf6b3c84a4ab592602745d072423ff4d6b8e6a39d (patch)
tree13462a44fa32b2f545731bd0a685a0f07aa1529c
parentcf0a706c15e7e82cceebbaf15a204f36ccece4d9 (diff)
downloadcpython-f6b3c84a4ab592602745d072423ff4d6b8e6a39d.zip
cpython-f6b3c84a4ab592602745d072423ff4d6b8e6a39d.tar.gz
cpython-f6b3c84a4ab592602745d072423ff4d6b8e6a39d.tar.bz2
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 ddd2e0b..6f266ab 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -13,6 +13,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 #19870: BaseCookie now parses 'secure' and 'httponly' flags.
Backport of issue #16611.
diff --git a/Modules/_io/fileio.c b/Modules/_io/fileio.c
index 58b68b6..6890ec3 100644
--- a/Modules/_io/fileio.c
+++ b/Modules/_io/fileio.c
@@ -577,9 +577,9 @@ fileio_readall(fileio *self)
}
continue;
}
- if (total > 0)
- break;
if (errno == EAGAIN) {
+ if (total > 0)
+ break;
Py_DECREF(result);
Py_RETURN_NONE;
}