Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-126018: Avoid aborting due to unnecessary assert insys.audit#126020

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
JelleZijlstra merged 7 commits intopython:mainfromdevdanzin:remove_sysaudit_assert
Oct 27, 2024

Conversation

@devdanzin
Copy link
Member

@devdanzindevdanzin commentedOct 26, 2024
edited by bedevere-appbot
Loading

This PR removes an assert insysmodule.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.

@picnixz
Copy link
Member

This likely requires some NEWS entry, for instance:

Fix a crash in:func:`sys.audit` when passing a non-string argument.
Eclips4 reacted with thumbs up emoji

@picnixzpicnixz removed the needs backport to 3.12only security fixes labelOct 26, 2024
@picnixz
Copy link
Member

FTR: 3.12 is not affected because the assertion does not exist:

if (!should_audit(tstate->interp)) {
Py_RETURN_NONE;
}
PyObject*auditEvent=args[0];
if (!auditEvent) {
_PyErr_SetString(tstate,PyExc_TypeError,
"expected str for argument 'event'");
returnNULL;
}
if (!PyUnicode_Check(auditEvent)) {
_PyErr_Format(tstate,PyExc_TypeError,
"expected str for argument 'event', not %.200s",
Py_TYPE(auditEvent)->tp_name);
returnNULL;
}

devdanzinand others added2 commitsOctober 26, 2024 20:53
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
@devdanzin
Copy link
MemberAuthor

Thank you very much for the review and suggestions@picnixz and@Eclips4!

Copy link
Member

@ZeroIntensityZeroIntensity left a 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.

@devdanzin
Copy link
MemberAuthor

This works, but I would be more comfortable just converting this to clinic.

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.

@JelleZijlstra
Copy link
Member

Converting to AC can wait for a later PR, and probably should be done only in main.

ZeroIntensity and AlexWaygood reacted with thumbs up emoji

@JelleZijlstraJelleZijlstra merged commit80eec52 intopython:mainOct 27, 2024
36 checks passed
@miss-islington-app
Copy link

Thanks@devdanzin for the PR, and@JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestOct 27, 2024
…it` (pythonGH-126020)(cherry picked from commit80eec52)Co-authored-by: devdanzin <74280297+devdanzin@users.noreply.github.com>Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
@bedevere-app
Copy link

GH-126042 is a backport of this pull request to the3.13 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.13bugs and security fixes labelOct 27, 2024
JelleZijlstra added a commit that referenced this pull requestOct 27, 2024
…dit` (GH-126020) (#126042)(cherry picked from commit80eec52)Co-authored-by: devdanzin <74280297+devdanzin@users.noreply.github.com>Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
picnixz added a commit to picnixz/cpython that referenced this pull requestDec 8, 2024
…it` (python#126020)Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
ebonnal pushed a commit to ebonnal/cpython that referenced this pull requestJan 12, 2025
…it` (python#126020)Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@picnixzpicnixzpicnixz left review comments

@ZeroIntensityZeroIntensityZeroIntensity left review comments

@Eclips4Eclips4Eclips4 left review comments

@JelleZijlstraJelleZijlstraJelleZijlstra approved these changes

@ericsnowcurrentlyericsnowcurrentlyAwaiting requested review from ericsnowcurrentlyericsnowcurrently is a code owner

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@devdanzin@picnixz@JelleZijlstra@ZeroIntensity@Eclips4

[8]ページ先頭

©2009-2025 Movatter.jp