-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
bpo-41192: Clarify the sys module's description of the auditing feature #22768
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
Conversation
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.
Overall, an improvement that I believe is correct.
Doc/library/sys.rst
Outdated
In general, any exceptions raised by this function should not be | ||
handled and should terminate the process as quickly as | ||
possible. This allows hook implementations to decide how to respond | ||
to any particular event. The typical responses will be to log the |
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 sort of duplicates what is said earlier, but probably OK.
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.
There's no other section or module to link to, so the body of these two functions is basically going to be it for documentation of this auditing feature, so I'm trying to cover everything, but your point about duplication is good!
I've reduced the discussion of sys.audit() a bit, leaving the hook order unspecified and taking out the PEP link. The bulk of the documentation is now on sys.addaudithook(), which seems like the more complicated function and embodies more of the feature's API.
Doc/library/sys.rst
Outdated
these errors should not be handled and should terminate the process as | ||
quickly as possible. | ||
Raise an auditing event and trigger any active auditing hooks. | ||
`event` is a string identifying the event, and `args` may contain |
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.
Travis does not like the backticks here and on 97. "default role"
Co-authored-by: Éric Araujo <[email protected]>
Thanks @akuchling for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8, 3.9. |
Sorry @akuchling, I had trouble checking out the |
GH-22820 is a backport of this pull request to the 3.8 branch. |
…re (pythonGH-22768) Co-authored-by: Éric Araujo <[email protected]> (cherry picked from commit 0c37269) Co-authored-by: Andrew Kuchling <[email protected]>
… feature (pythonGH-22768) Co-authored-by: Éric Araujo <[email protected]> (cherry picked from commit 0c37269) Co-authored-by: Andrew Kuchling <[email protected]>
GH-22821 is a backport of this pull request to the 3.9 branch. |
…re (pythonGH-22768) Co-authored-by: Éric Araujo <[email protected]>
While looking at another PR for this ticket, I learned about 3.8's new auditing feature but found the sys module docs to be rather cryptic. This PR adds some text from the original PEP, adds a link to the PEP, and does some rewriting for clarity. I think the two functions now sufficiently explain what the auditing feature is for & how to use it.
https://bugs.python.org/issue41192