-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
gh-126018: Avoid aborting due to unnecessary assert in sys.audit
#126020
Conversation
This likely requires some NEWS entry, for instance: Fix a crash in :func:`sys.audit` when passing a non-string argument. |
FTR: 3.12 is not affected because the assertion does not exist: Lines 499 to 514 in 67b2701
|
Co-authored-by: Bénédikt Tran <[email protected]>
Misc/NEWS.d/next/Core_and_Builtins/2024-10-26-23-50-03.gh-issue-126018.Hq-qcM.rst
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works, but I would be more comfortable just converting this to clinic.
Co-authored-by: Jelle Zijlstra <[email protected]>
I'm not too attached to this PR, but converting to AC is beyond my skills. If you or someone else wants to propose another PR with that approach, I'll gladly close this one. |
Converting to AC can wait for a later PR, and probably should be done only in main. |
Thanks @devdanzin for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13. |
…it` (pythonGH-126020) (cherry picked from commit 80eec52) Co-authored-by: devdanzin <[email protected]> Co-authored-by: Bénédikt Tran <[email protected]> Co-authored-by: Jelle Zijlstra <[email protected]>
GH-126042 is a backport of this pull request to the 3.13 branch. |
…dit` (GH-126020) (#126042) (cherry picked from commit 80eec52) Co-authored-by: devdanzin <[email protected]> Co-authored-by: Bénédikt Tran <[email protected]> Co-authored-by: Jelle Zijlstra <[email protected]>
This PR removes an assert in
sysmodule.c
that caused the interpreter to abort whensys.audit
received a non-string as first argument.Without this assert, the code that runs the hooks will raise an exception instead.
sys.audit(0)
aborts due to an assertion in debug build #126018