A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2013-July/127395.html below:

[Python-Dev] cpython: Issue #18408: Fix fileio_read() on _PyBytes_Resize() failure

[Python-Dev] cpython: Issue #18408: Fix fileio_read() on _PyBytes_Resize() failure [Python-Dev] cpython: Issue #18408: Fix fileio_read() on _PyBytes_Resize() failureVictor Stinner victor.stinner at gmail.com
Wed Jul 17 00:35:17 CEST 2013
2013/7/17 Serhiy Storchaka <storchaka at gmail.com>:
> Oh, I meaned Py_XDECREF.

Ah ok :-) Well, for this specific code, it can probably be replaced with:

         if (_PyBytes_Resize(&bytes, n) < 0)
             return NULL;

I'm not sure that _PyBytes_Resize() *always* decref bytes and then set
bytes to NULL. I was too lazy to check this.

If someone wants to audit the code of _PyBytes_Resize(), there are
many other places where Py_XDECREF / Py_CLEAR can be removed on
_PyBytes_Resize() failure.

And I'm quite sure that there are still places where Py_DECREF() is
still used on _PyBytes_Resize() failure ;-)

Victor
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4