]> 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 21:12:48 +0000 (23:12 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Wed, 2 Jul 2014 21:12:48 +0000 (23:12 +0200)
it ignored I/O errors if at least the first C call read() succeed.

Misc/NEWS
Modules/_io/fileio.c

index ddd2e0b54887704a9b552743df9f183ff6224292..6f266ab245e6b69866cd15f9eaa9357aa19065c5 100644 (file)
--- 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.
 
index 58b68b6a0a887f473777fc48210433637a1ee336..6890ec3e5e145c529e29077c0716adef7b8f8fdc 100644 (file)
@@ -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;
             }