Skip to content

bpo-46025: Fix a crash in the atexit module for auto-unregistering functions #30002

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 9, 2021

Conversation

pablogsal
Copy link
Member

@pablogsal pablogsal commented Dec 9, 2021

pablogsal and others added 2 commits December 9, 2021 13:16
Co-authored-by: Victor Stinner <[email protected]>
Co-authored-by: Christian Heimes <[email protected]>
Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks, I'm feeling more confident with catch_unraisable_exception.

I'm surprised that no other atexit uses catch_unraisable_exception.

atexit._run_exitfuncs()
self.assertEqual(cm.unraisable.object, func)
self.assertEqual(cm.unraisable.exc_type, ZeroDivisionError)
self.assertEqual(type(cm.unraisable.exc_value), ZeroDivisionError)
Copy link
Member

Choose a reason for hiding this comment

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

Not sure if checking exc_value is needed, but it's ok to test it :-)

Copy link
Member Author

Choose a reason for hiding this comment

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

This makes it a military-grade test :)

@miss-islington
Copy link
Contributor

@pablogsal: Status check is done, and it's a failure ❌ .

1 similar comment
@miss-islington
Copy link
Contributor

@pablogsal: Status check is done, and it's a failure ❌ .

@pablogsal pablogsal merged commit f0d290d into python:main Dec 9, 2021
@pablogsal pablogsal deleted the bpo-46025 branch December 9, 2021 13:53
@miss-islington
Copy link
Contributor

Thanks @pablogsal for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10.
🐍🍒⛏🤖

@bedevere-bot
Copy link

GH-30005 is a backport of this pull request to the 3.10 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.10 only security fixes label Dec 9, 2021
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 9, 2021
…nctions (pythonGH-30002)

(cherry picked from commit f0d290d)

Co-authored-by: Pablo Galindo Salgado <[email protected]>
pablogsal added a commit that referenced this pull request Dec 9, 2021
…nctions (GH-30002) (GH-30005)

(cherry picked from commit f0d290d)

Co-authored-by: Pablo Galindo Salgado <[email protected]>

Co-authored-by: Pablo Galindo Salgado <[email protected]>
@vstinner
Copy link
Member

vstinner commented Dec 9, 2021

Thanks for the fix ;-)

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.

6 participants