Skip to content

Conversation

@vstinner
Copy link
Member

@vstinner vstinner commented Mar 13, 2020

If PySys_Audit() fails in PyEval_SetProfile() or PyEval_SetTrace(),
log the error as an unraisable exception.

https://bugs.python.org/issue35370

If PySys_Audit() fails in PyEval_SetProfile() or PyEval_SetTrace(),
log the error as an unraisable exception.
@vstinner
Copy link
Member Author

@zooba @tiran: if PySys_Audit() fails in PyEval_SetProfile() or PyEval_SetTrace(), the trace/profile function is not set but an exception is "leaked" to the caller which may not be prepared for that. In Python 3.7, PyEval_SetProfile() or PyEval_SetTrace() couldn't raise an exception. Does it sound like a reasonable comprise to you to log the "unraisable" error, rather than leaking it to the caller?

That's the fix for the C API. I already fixed the issue in the Python API in my previous commit: commit 309d7cc.

Once the issue will be fixed in the C API and Python API in master, I will write a fix for 3.8 as well.

@vstinner vstinner merged commit f6a5850 into python:master Mar 16, 2020
@vstinner vstinner deleted the eval_audit_error branch March 16, 2020 16:41
vstinner added a commit that referenced this pull request Mar 16, 2020
If PySys_Audit() fails in PyEval_SetProfile() or PyEval_SetTrace(),
log the error as an unraisable exception.

(cherry picked from commit f6a5850)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants