[issue12175] FileIO.readall() read the file position and size at each read

Antoine Pitrou report at bugs.python.org
Wed May 25 17:20:51 CEST 2011


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

About rawiobase_readall.patch: why do you use PyObject_Size() if you know chunks is a list? PyList_GET_SIZE is much more efficient.

About bufferedreader_readall.patch:

+            PyBytes_Concat(&data, all);
+            if (data == NULL)
+                return NULL;

You must Py_DECREF(all) first.

Also, you should check that "all" is either None or a bytes object.

----------

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


More information about the Python-bugs-list mailing list