Skip to content

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

Merged
akuchling merged 5 commits into
python:masterfrom
gousaiyang:bpo-41192
Oct 20, 2020
Merged

bpo-41192: Add documentation to some undocumented audit events#21308
akuchling merged 5 commits into
python:masterfrom
gousaiyang:bpo-41192

Conversation

@gousaiyang

@gousaiyang gousaiyang commented Jul 4, 2020

Copy link
Copy Markdown
Contributor
  • 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

@akuchling akuchling left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread Doc/library/audit_events.rst Outdated
+--------------------------+-------------------------------------------+
| _winapi.TerminateProcess | ``handle``, ``exit_code`` |
+--------------------------+-------------------------------------------+
| ctypes.PyObj_FromPtr | ``ob`` |

@akuchling akuchling Oct 19, 2020

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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
…1308)

(cherry picked from commit 3f7e990)

Co-authored-by: Saiyang Gou <gousaiyang@163.com>
@bedevere-bot

Copy link
Copy Markdown

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
…1308)

(cherry picked from commit 3f7e990)

Co-authored-by: Saiyang Gou <gousaiyang@163.com>
@bedevere-bot

Copy link
Copy Markdown

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