Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
gh-129502: Fix handling errors in ctypes callbacks#129504
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
gh-129502: Fix handling errors in ctypes callbacks#129504
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Unlikely errors in preparing arguments for ctypes callback are nowhandled in the same way as errors raised in the callback of in convertingthe result of the callback -- using sys.unraisablehook() instead ofsys.excepthook() and not setting sys.last_exc and other variables.
serhiy-storchaka commentedJan 31, 2025
It is difficult to create tests for these changes, because the way to trigger such errors is memory allocation failure. If there is other way, I don't know about it (I did not dig very deep). |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Victor Stinner <vstinner@python.org>
vstinner left a comment
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.
LGTM
9d63ae5 intopython:mainUh oh!
There was an error while loading.Please reload this page.
Thanks@serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13. |
…9504)Unlikely errors in preparing arguments for ctypes callback are nowhandled in the same way as errors raised in the callback of in convertingthe result of the callback -- using sys.unraisablehook() instead ofsys.excepthook() and not setting sys.last_exc and other variables.(cherry picked from commit9d63ae5)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
GH-129517 is a backport of this pull request to the3.13 branch. |
Sorry,@serhiy-storchaka, I could not cleanly backport this to |
…#129517)gh-129502: Fix handling errors in ctypes callbacks (GH-129504)Unlikely errors in preparing arguments for ctypes callback are nowhandled in the same way as errors raised in the callback of in convertingthe result of the callback -- using sys.unraisablehook() instead ofsys.excepthook() and not setting sys.last_exc and other variables.(cherry picked from commit9d63ae5)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
…onGH-129504)Unlikely errors in preparing arguments for ctypes callback are nowhandled in the same way as errors raised in the callback of in convertingthe result of the callback -- using sys.unraisablehook() instead ofsys.excepthook() and not setting sys.last_exc and other variables.(cherry picked from commit9d63ae5)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
GH-129639 is a backport of this pull request to the3.12 branch. |
…#129639)Unlikely errors in preparing arguments for ctypes callback are nowhandled in the same way as errors raised in the callback of in convertingthe result of the callback -- using sys.unraisablehook() instead ofsys.excepthook() and not setting sys.last_exc and other variables.(cherry picked from commit9d63ae5)
…9504)Unlikely errors in preparing arguments for ctypes callback are nowhandled in the same way as errors raised in the callback of in convertingthe result of the callback -- using sys.unraisablehook() instead ofsys.excepthook() and not setting sys.last_exc and other variables.
Uh oh!
There was an error while loading.Please reload this page.
Unlikely errors in preparing arguments for ctypes callback are now handled in the same way as errors raised in the callback of in converting the result of the callback -- using sys.unraisablehook() instead of sys.excepthook() and not setting sys.last_exc and other variables.