-
-
Notifications
You must be signed in to change notification settings - Fork 182
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
Exceptions (ignored) in finalizers running during interpreter shutdown #173
Comments
FWIW I didn't confirm this is necessary, it's copied from the linked PR. It seems like since Python 3.4 and PEP-442 global variables aren't set to None during shutdown any more, so the module may still be accessible the normal way. |
This explanation and fix makes sense, can you submit a PR?
Can you try leaving it out of your patch and running your build a bunch to see if you still get the error? I'd prefer not including patterns that are no longer needed. |
Done!
Good idea. It seems not necessary here (whereas without the check I see the "Exception ignored" messages 100% of the time.) |
Hi!
I think under some circumstances weakref callbacks from blinker 1.8.2 signals raise exceptions during interpreter shutdown, leading to "Exception ignored" errors right on exit. For example:
Context
I'm sorry that I don't have a reproducer for this. I've tried, but as it seems to depend on order of finalizers during shutdown I can't seem to figure out a sequence that makes it trigger. I see it building my blog as a static site using the Pelican static site generator, and it's been reported as a bug against the Pelican sitemap plugin here: pelican-plugins/sitemap#35
Running pelican under pdb I can see that the only weakrefs created are from
blinker
. The sitemap plugin connects up three signals, everything works as expected, and then three ignored exceptions are logged when exiting pdm (as this is when the Python interpreter exits):Click for pdm session log breaking on all new weakrefs and showing the errors
Possible fix
Happy to submit the patch as a PR if that's helpful for you, but I'm not certain it's the right fix.
Thanks for your time, please let me know if I can provide any other information.
Python version: 3.12
Blinker version: 1.8.2
The text was updated successfully, but these errors were encountered: