[Python-checkins] cpython (2.7): Issue #21090: io.FileIO.readall() does not ignore I/O errors anymore. Before,

victor.stinner python-checkins at python.org
Wed Jul 2 23:14:19 CEST 2014


http://hg.python.org/cpython/rev/1492a42b8308
changeset:   91527:1492a42b8308
branch:      2.7
parent:      91523:0ba6ebd90b9d
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Wed Jul 02 23:12:48 2014 +0200
summary:
  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.

files:
  Misc/NEWS            |  3 +++
  Modules/_io/fileio.c |  4 ++--
  2 files changed, 5 insertions(+), 2 deletions(-)


diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -13,6 +13,9 @@
 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
--- a/Modules/_io/fileio.c
+++ b/Modules/_io/fileio.c
@@ -577,9 +577,9 @@
                 }
                 continue;
             }
-            if (total > 0)
-                break;
             if (errno == EAGAIN) {
+                if (total > 0)
+                    break;
                 Py_DECREF(result);
                 Py_RETURN_NONE;
             }

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list