classification
Title: Audit events for unhandled exceptions
Type: enhancement Stage: resolved
Components: Versions: Python 3.9, Python 3.8
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: steve.dower Nosy List: steve.dower, vstinner
Priority: normal Keywords: patch

Created on 2019-11-26 17:15 by steve.dower, last changed 2019-12-02 19:10 by steve.dower. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 17392 merged steve.dower, 2019-11-26 17:21
PR 17393 merged steve.dower, 2019-11-26 18:39
Messages (3)
msg357517 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2019-11-26 17:15
We currently have no audit events for unhandled exceptions.

While these can be recorded by sys.excepthook or sys.unraisablehook in Python code, there is no way to intercept them from C code set up before running Python code. There's also no way to collect information about what hook is running, in the case where Python code may have overridden it (for example, to suppress error reporting when malicious code fails).
msg357530 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2019-11-26 20:14
+Victor in case you'd like to check my changes to the unraisable hook implementation.
msg357620 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2019-11-28 16:46
New changeset bea33f5e1db6e4a554919a82894f44568576e979 by Steve Dower in branch 'master':
bpo-38920: Add audit hooks for when sys.excepthook and sys.unraisable hooks are invoked (GH-17392)
https://github.com/python/cpython/commit/bea33f5e1db6e4a554919a82894f44568576e979
msg357621 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2019-11-28 16:46
New changeset b74a6f14b94d36fb72b1344663e81776bf450847 by Steve Dower in branch '3.8':
bpo-38920: Add audit hooks for when sys.excepthook and sys.unraisablehook are invoked (GH-17392)
https://github.com/python/cpython/commit/b74a6f14b94d36fb72b1344663e81776bf450847
History
Date User Action Args
2019-12-02 19:10:42steve.dowersetstatus: open -> closed
resolution: fixed
stage: commit review -> resolved
2019-11-28 16:47:39steve.dowersetstage: patch review -> commit review
2019-11-28 16:46:31steve.dowersetmessages: + msg357620
2019-11-28 16:46:31steve.dowersetmessages: + msg357621
2019-11-26 20:14:46steve.dowersetnosy: + vstinner
messages: + msg357530
2019-11-26 18:39:57steve.dowersetpull_requests: + pull_request16875
2019-11-26 17:21:33steve.dowersetassignee: steve.dower
2019-11-26 17:21:02steve.dowersetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request16874
2019-11-26 17:15:28steve.dowercreate