]> granicus.if.org Git - python/commitdiff
Issue #21090: io.FileIO.readall() does not ignore I/O errors anymore. Before,
authorVictor Stinner <victor.stinner@gmail.com>
Wed, 2 Jul 2014 20:59:31 +0000 (22:59 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Wed, 2 Jul 2014 20:59:31 +0000 (22:59 +0200)
it ignored I/O errors if at least the first C call read() succeed.

Misc/NEWS
Modules/_io/fileio.c

index 0efa8150d544b116b1167cece0c546b63ef6459a..0983a59c954719d24abff44b1cef33cd2d2c9e09 100644 (file)
--- 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
index cbb2daf5c291af71a4a82a410ef0ee21788d4415..81e2906a2643c5d3513131ffad6a8a3b22866770 100644 (file)
@@ -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;
             }