Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged

Conversation

@serhiy-storchaka
Copy link
Member

@serhiy-storchakaserhiy-storchaka commentedJan 31, 2025
edited by bedevere-appbot
Loading

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.

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
Copy link
MemberAuthor

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).

Co-authored-by: Victor Stinner <vstinner@python.org>
Copy link
Member

@vstinnervstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM

@serhiy-storchakaserhiy-storchaka merged commit9d63ae5 intopython:mainJan 31, 2025
46 checks passed
@miss-islington-app
Copy link

Thanks@serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

@serhiy-storchakaserhiy-storchaka deleted the ctypes-callback-errors branchJanuary 31, 2025 13:30
miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestJan 31, 2025
…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>
@bedevere-app
Copy link

GH-129517 is a backport of this pull request to the3.13 branch.

@miss-islington-app
Copy link

Sorry,@serhiy-storchaka, I could not cleanly backport this to3.12 due to a conflict.
Please backport usingcherry_picker on command line.

cherry_picker 9d63ae5fe52d95059ab1bcd4cbb1f9e17033c897 3.12

@bedevere-appbedevere-appbot removed the needs backport to 3.13bugs and security fixes labelJan 31, 2025
Yhg1s pushed a commit that referenced this pull requestFeb 4, 2025
…#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>
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull requestFeb 4, 2025
…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>
@bedevere-app
Copy link

GH-129639 is a backport of this pull request to the3.12 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.12only security fixes labelFeb 4, 2025
Yhg1s pushed a commit that referenced this pull requestFeb 4, 2025
…#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)
srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this pull requestFeb 7, 2025
…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.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@vstinnervstinnervstinner approved these changes

@encukouencukouAwaiting requested review from encukou

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@serhiy-storchaka@vstinner

[8]ページ先頭

©2009-2025 Movatter.jp