[issue9971] Optimize BufferedReader.readinto

Antoine Pitrou report at bugs.python.org
Fri May 6 17:43:24 CEST 2011


Antoine Pitrou <pitrou at free.fr> added the comment:

+        if (n <= 0) {
+            if (written > 0 || n == 0)
+                break;
+            if (n == -2) {
+                Py_INCREF(Py_None);
+                res = Py_None;
+            }
+            goto end;
+        }

I think the logic is flawed: if n = -1 and written is > 0, the error will be silenced.
Other than that, the patch looks good to me.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9971>
_______________________________________


More information about the Python-bugs-list mailing list