gh-126018: Avoid aborting due to unnecessary assert in sys.audit#126020
gh-126018: Avoid aborting due to unnecessary assert in sys.audit#126020JelleZijlstra merged 7 commits intopython:mainfrom
sys.audit#126020Conversation
|
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
ZeroIntensity
left a comment
There was a problem hiding this comment.
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]>
…it` (python#126020) Co-authored-by: Bénédikt Tran <[email protected]> Co-authored-by: Jelle Zijlstra <[email protected]>
…it` (python#126020) Co-authored-by: Bénédikt Tran <[email protected]> Co-authored-by: Jelle Zijlstra <[email protected]>
This PR removes an assert in
sysmodule.cthat caused the interpreter to abort whensys.auditreceived 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