Skip to content

bpo-41192: Add documentation to some undocumented audit events #21308

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

Merged
merged 5 commits into from
Oct 20, 2020

Conversation

gousaiyang
Copy link
Contributor

@gousaiyang gousaiyang commented Jul 4, 2020

  • Document builtins.id, ctypes.PyObj_FromPtr, function.__new__, object.__getattr__, object.__setattr__, object.__delattr__, setopencodehook and _winapi events
  • Explain when code.__new__, function.__new__, object.__getattr__, object.__setattr__, object.__delattr__ are raised
  • Add a section in audit_events.rst to place internal audit events without corresponding documentation sections

https://bugs.python.org/issue41192

- Document `builtins.id`, `ctypes.PyObj_FromPtr`, `function.__new__`, `object.__getattr__`, `object.__setattr__`, `object.__delattr__`, `setopencodehook` and `_winapi` events
- Explain when `code.__new__`, `function.__new__`, `object.__getattr__`, `object.__setattr__`, `object.__delattr__` are raised
- Add a section in `audit_events.rst` to place internal audit events without corresponding documentation sections
Copy link
Contributor

@akuchling akuchling left a comment

Choose a reason for hiding this comment

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

Looks good to me. The documentation formats correctly, and the new entries result in table rows that link to the correct anchors on their destination page. I also dug around in the C source with grep to look for other undocumented event types, but didn't find any.

+--------------------------+-------------------------------------------+
| _winapi.TerminateProcess | ``handle``, ``exit_code`` |
+--------------------------+-------------------------------------------+
| ctypes.PyObj_FromPtr | ``ob`` |
Copy link
Contributor

@akuchling akuchling Oct 19, 2020

Choose a reason for hiding this comment

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

One note -- these aren't named parameters, right? The C variable with the value is named "ob" in the source code, but would this be clearer as "obj"? @gousaiyang: what do you think? If you prefer to leave it as-is, I can go ahead and merge this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, these parameters are positional-only under the hood. And naming it as obj is indeed clearer. I've made the change. Thanks for your review!

@gousaiyang gousaiyang requested a review from a team as a code owner October 19, 2020 19:41
@akuchling akuchling self-assigned this Oct 20, 2020
@akuchling akuchling merged commit 3f7e990 into python:master Oct 20, 2020
@miss-islington
Copy link
Contributor

Thanks @gousaiyang for the PR, and @akuchling for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8, 3.9.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 20, 2020
@bedevere-bot bedevere-bot removed the needs backport to 3.9 only security fixes label Oct 20, 2020
@bedevere-bot
Copy link

GH-22831 is a backport of this pull request to the 3.9 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 20, 2020
@bedevere-bot
Copy link

GH-22832 is a backport of this pull request to the 3.8 branch.

@gousaiyang gousaiyang deleted the bpo-41192 branch October 20, 2020 19:24
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants