-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
[3.13] gh 10000 -130163: Fix crashes related to PySys_GetObject() (GH-130503) #130556
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[3.13] gh-130163: Fix crashes related to PySys_GetObject() (GH-130503) #130556
Conversation
…honGH-130503) 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) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12. |
Sorry, @serhiy-storchaka, I could not cleanly backport this to
|
This change introduced reference leaks in the 3.13 branch. Example:
cc @encukou |
Example of buildbot failure, Fedora Stable (x86): https://buildbot.python.org/#/builders/1471/builds/551 Failed tests:
|
…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>
GH-130576 is a backport of this pull request to the 3.12 branch. |
GH-130556) (GH-130576) 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) (cherry picked from commit 2ab7e11)
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)
print
and concurrently modifyingsys.stdout
#130163