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
Improve shutdown exception ignored message #50543
Comments
When (at least sometimes) exceptions occur during shutdown, warnings This is apparently meant to be read as instead of, for instance Even when parsed correctly, it is a bit mysterious (who/what ignored the Suggestion (from John Machin): reword to something like Shutdown ignored this exception: TypeError: "'NoneType' object is not This would tell people that they might need to find out more about the Would it be permissible to change this in 3.1? |
Since 3.1 is in final release candidate, a change like this is not This error message is generated in PyErr_WriteUnraisable, which is The reason this message is so mysterious is that in this particular case Exception TypeError: "'NoneType' object is not callable" in <unknown> which is more easily parsed correctly. As long as we're mucking about The following Exception of type TypeError was raised in <unknown> but |
I should have said 3.1.1. Ie, would this be a bug fix or really a new |
Ah, in that case then yes, the message bug can be fixed in 3.1.1 and |
I agree with R. David Murray's suggestions, and have implemented it in the attached patch. |
Not sure what the original method to cause this message is. I’m guessing some code was trying to call a function that was set to None by the shutdown process, causing the exception message, and that repr() was also failing, causing the broken wording. Like this: $ python2 << PYTHON
> class C:
> def __repr__(self): return None()
> def __del__(self): None()
> x = C()
> PYTHON
Exception TypeError: "'NoneType' object is not callable" in ignored If this is the case, then it is the same problem as bpo-22836, where I have posted a test and a fix for Python 3. |
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: