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
Error in atexit._run_exitfuncs [...] Exception expected for value, str found #54965
Comments
public@colinux 3 ~: python3.2
Python 3.2b2 (py3k, Dec 22 2010, 02:38:55)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import atexit; atexit.register(lambda:1/0)
<function <lambda> at 0xb7c7e12c>
>>> exit()
Error in atexit._run_exitfuncs:
TypeError: print_exception(): Exception expected for value, str found might b related to bpo-5089, so included those ppl to nosy. this bug is subtle. unit tests which explicitly 'raise' exceptions will not b caught, e.g. this will raise properly: @exit.register
def foo(): raise ZeroDivisionError() |
It's because Attached is a patch which fixes the issue and adds a test for it. I used exactly the same code ("1 / 0") to raise the exception, as I don't know if there is some clean way to raise an unnormalized exception. |
Looks good to me. I’d just move the raising function into the test method (no need to update the patch). |
+1. |
So I guess someone should feel responsible and commit that patch. For convenience, I updated the patch to inline the raise. |
I think Antoine might be interested. |
Commited as r87755+r87758. Wait for the buildbot before backporting to other versions. |
should this bug b closed? it seems fixed in python3.2 for me. |
Well, Victor still wanted to backport it. |
New changeset 461e37a60187 by Victor Stinner in branch '3.1': |
Oh, I forgot the issue. I backported the fix to Python 3.1. Python 2.7 doesn't have the bug. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: