From: Victor Stinner Date: Wed, 2 Jul 2014 21:12:48 +0000 (+0200) Subject: Issue #21090: io.FileIO.readall() does not ignore I/O errors anymore. Before, X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f6b3c84a4ab592602745d072423ff4d6b8e6a39d;p=python 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. --- diff --git a/Misc/NEWS b/Misc/NEWS index ddd2e0b548..6f266ab245 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 58b68b6a0a..6890ec3e5e 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; }