Skip to content

[3.12] gh-130163: Fix crashes related to PySys_GetObject() (GH-130503) (GH-130556) - #130576

Merged
serhiy-storchaka merged 3 commits into
python:3.12from
serhiy-storchaka:backport-7c1b76f-3.12
Feb 26, 2025
Merged

[3.12] gh-130163: Fix crashes related to PySys_GetObject() (GH-130503) (GH-130556)#130576
serhiy-storchaka merged 3 commits into
python:3.12from
serhiy-storchaka:backport-7c1b76f-3.12

Conversation

@serhiy-storchaka

@serhiy-storchakaserhiy-storchaka commented Feb 26, 2025

Copy link
Copy Markdown
Member

The use of PySys_GetObject() and _PySys_GetAttr(), which return a borrowed reference, has been replaced by using one of the following functions, which return a strong reference and distinguish a missing attribute from an error: _PySys_GetOptionalAttr(), _PySys_GetOptionalAttrString(), _PySys_GetRequiredAttr(), and _PySys_GetRequiredAttrString(). (cherry picked from commit 0ef4ffe) (cherry picked from commit 7c1b76f)

…honGH-130503) (pythonGH-130556)
The use of PySys_GetObject() and _PySys_GetAttr(), which return a borrowed
reference, has been replaced by using one of the following functions, which
return a strong reference and distinguish a missing attribute from an error:
_PySys_GetOptionalAttr(), _PySys_GetOptionalAttrString(),
_PySys_GetRequiredAttr(), and _PySys_GetRequiredAttrString().
(cherry picked from commit 0ef4ffe)
(cherry picked from commit 7c1b76f)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic-free-threadingtype-crashA hard crash of the interpreter, possibly with a core dump

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@serhiy-storchaka