Staging
v0.5.1
https://github.com/python/cpython
Revision 526ef856dd598fd3cefdfadeb18ede7a8e57aa41 authored by Pablo Galindo on 08 October 2019, 20:38:11 UTC, committed by GitHub on 08 October 2019, 20:38:11 UTC
The implementation of weakref.proxy's methods call back into the Python
API using a borrowed references of the weakly referenced object
(acquired via PyWeakref_GET_OBJECT). This API call may delete the last
reference to the object (either directly or via GC), leaving a dangling
pointer, which can be subsequently dereferenced.

To fix this, claim a temporary ownership of the referenced object when
calling the appropriate method. Some functions because at the moment they
do not need to access the borrowed referent, but to protect against
future changes to these functions, ownership need to be fixed in
all potentially affected methods..
(cherry picked from commit 10cd00a9e3c22af37c748ea5a417f6fb66601e21)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
1 parent 7162440
Raw File
Tip revision: 526ef856dd598fd3cefdfadeb18ede7a8e57aa41 authored by Pablo Galindo on 08 October 2019, 20:38:11 UTC
[3.8] bpo-38395: Fix ownership in weakref.proxy methods (GH-16632) (GH-16662)
Tip revision: 526ef85
CODE_OF_CONDUCT.md
# Code of Conduct

Please note that all interactions on
[Python Software Foundation](https://www.python.org/psf-landing/)-supported
infrastructure is [covered](https://www.python.org/psf/records/board/minutes/2014-01-06/#management-of-the-psfs-web-properties)
by the [PSF Code of Conduct](https://www.python.org/psf/codeofconduct/),
which includes all the infrastructure used in the development of Python itself
(e.g. mailing lists, issue trackers, GitHub, etc.).

In general, this means that everyone is expected to be **open**, **considerate**, and
**respectful** of others no matter what their position is within the project.

back to top