Skip to content

Conversation

@vstinner
Copy link
Member

@vstinner vstinner commented Jan 8, 2026

Hold a strong reference to 'hook' while calling the default unraisable took to log hook failure.

Fix test_sys.UnraisableHookTest: use the right decorator function to disable colors. Previously, tests were always skipped.

Hold a strong reference to 'hook' while calling the default
unraisable took to log hook failure.

Fix test_sys.UnraisableHookTest: use the right decorator function to
disable colors. Previously, tests were always skipped.
Copy link
Member

@ZeroIntensity ZeroIntensity left a comment

Choose a reason for hiding this comment

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

This looks user-facing, so I think it would be a good idea to add a news entry, but I'll leave the decision up to you. The rest of the PR looks good to me.

@vstinner
Copy link
Member Author

vstinner commented Jan 8, 2026

I think it would be a good idea to add a news entry

Ok, I added a NEWS entry.

@vstinner vstinner merged commit 39a2bcf into python:main Jan 9, 2026
46 checks passed
@vstinner vstinner deleted the unraisablehook branch January 9, 2026 12:16
@miss-islington-app
Copy link

Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Sorry, @vstinner, I could not cleanly backport this to 3.14 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 39a2bcf949095bd603f7b73f15b5b478dbb49ba9 3.14

@miss-islington-app
Copy link

Sorry, @vstinner, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 39a2bcf949095bd603f7b73f15b5b478dbb49ba9 3.13

@bedevere-app
Copy link

bedevere-app bot commented Jan 9, 2026

GH-143603 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Jan 9, 2026
@vstinner vstinner removed the needs backport to 3.13 bugs and security fixes label Jan 9, 2026
vstinner added a commit to vstinner/cpython that referenced this pull request Jan 9, 2026
Hold a strong reference to 'hook' while calling the default
unraisable took to log hook failure.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants