-
-
Notifications
You must be signed in to change notification settings - Fork 29.2k
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-119402: Add import/module audit event #119122
base: main
Are you sure you want to change the base?
Conversation
This adds a balancing "import.complete" audit event matching the existing "import" audit event, which allows the audit system to be used to observe programatically the same import timing information that is logged by PYTHONPROFILEIMPORTTIME. The current import audit event may be fired twice for imports of native modules. The second import event can be distinguished from the first because the second argument is always non-None in this case, whereas it is always None in the first case.
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
@zooba - Thomas Wouters suggested that you were a good person to tag on this change. |
Is this change small enough that it doesn't need an issue? |
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
@nineteendo I'm not sure what the convention is here. I'm happy to create an issue if that's preferred. I'm also aware that there should be a documentation change, which I've added (I hope; the convention for documenting audit events isn't totally clear - especially when they need additional text). |
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Co-authored-by: Steve Dower <steve.dower@microsoft.com>
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
This needs a NEWS entry (just a basic |
|
||
One or more ``import`` events may occur for the same module name. An | ||
``import/module`` event is generated for a given module name after the | ||
first time the module is loaded and initialized, or loading fails. |
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.
Should probably add: On failure, the value of *module* will be ``None``.
(assuming that it will be None, and not something else.)
This adds a balancing "import.complete" audit event matching the existing "import" audit event, which allows the audit system to be used to observe programatically the same import timing information that is logged by PYTHONPROFILEIMPORTTIME.
The current import audit event may be fired twice for imports of native modules. The second import event can be distinguished from the first because the second argument is always non-None in this case, whereas it is always None in the first case.