Skip to content
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-91348: Restore frame argument to sys._getframe audit event #94928

Merged
merged 3 commits into from
Jul 17, 2022

Conversation

zooba
Copy link
Member

@zooba zooba commented Jul 17, 2022

gh-91348: Restore frame argument to sys._getframe audit event
Update docs (the argument was always there, but previously undocumented)

Update docs (the argument was always there, but previously undocumented)
@@ -1793,7 +1789,13 @@ sys__getframe_impl(PyObject *module, int depth)
"call stack is not deep enough");
return NULL;
}
return _Py_XNewRef((PyObject *)_PyFrame_GetFrameObject(frame));

PyObject *pyFrame = _Py_XNewRef((PyObject *)_PyFrame_GetFrameObject(frame));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
PyObject *pyFrame = _Py_XNewRef((PyObject *)_PyFrame_GetFrameObject(frame));
PyObject *pyFrame = Py_XNewRef((PyObject *)_PyFrame_GetFrameObject(frame));

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason this wasn't changed here when the public name was added? This line wasn't my change.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like an oversight Py_XNewRef is just an alias for _Py_XNewRef but without underscore looks better. Either way is fine.

zooba and others added 2 commits July 17, 2022 15:39
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
@zooba
Copy link
Member Author

zooba commented Jul 17, 2022

I pushed a slightly different change, because we don't particularly care about auditing if the frame can't be found.

Copy link
Contributor

@kumaraditya303 kumaraditya303 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zooba zooba merged commit 044a593 into python:main Jul 17, 2022
@miss-islington
Copy link
Contributor

Thanks @zooba for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Sorry @zooba, I had trouble checking out the 3.11 backport branch.
Please backport using cherry_picker on command line.
cherry_picker 044a593cbbe1639e906e06c47504dd1020ddfee4 3.11

@zooba zooba added needs backport to 3.11 only security fixes and removed needs backport to 3.11 only security fixes labels Jul 17, 2022
@miss-islington
Copy link
Contributor

Thanks @zooba for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖

@zooba zooba deleted the gh91348 branch July 17, 2022 15:16
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 17, 2022
…ythonGH-94928)

(cherry picked from commit 044a593)

Co-authored-by: Steve Dower <steve.dower@python.org>
@bedevere-bot bedevere-bot removed the needs backport to 3.11 only security fixes label Jul 17, 2022
@bedevere-bot
Copy link

GH-94932 is a backport of this pull request to the 3.11 branch.

miss-islington added a commit that referenced this pull request Jul 17, 2022
(cherry picked from commit 044a593)

Co-authored-by: Steve Dower <steve.dower@python.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants