From: Victor Stinner Date: Wed, 2 Jul 2014 20:59:31 +0000 (+0200) Subject: Issue #21090: io.FileIO.readall() does not ignore I/O errors anymore. Before, X-Git-Tag: v3.4.2rc1~271 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e10920f0d1009ea33ce4b35b015a928b33a80867;p=thirdparty%2FPython%2Fcpython.git 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 0efa8150d544..0983a59c9547 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -27,6 +27,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 #21781: ssl.RAND_add() now supports strings longer than 2 GB. - Issue #11453: asyncore: emit a ResourceWarning when an unclosed file_wrapper diff --git a/Modules/_io/fileio.c b/Modules/_io/fileio.c index cbb2daf5c291..81e2906a2643 100644 --- a/Modules/_io/fileio.c +++ b/Modules/_io/fileio.c @@ -691,9 +691,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; }