[Python-Dev] Revert #12085 fix for del attribute error message (original) (raw)
Nick Coghlan ncoghlan at gmail.com
Mon Sep 23 23:19:14 CEST 2013
- Previous message: [Python-Dev] Revert #12085 fix for __del__ attribute error message
- Next message: [Python-Dev] Revert #12085 fix for __del__ attribute error message
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 24 Sep 2013 01:24, "Antoine Pitrou" <solipsis at pitrou.net> wrote:
On Mon, 23 Sep 2013 18:51:04 +1000 Nick Coghlan <ncoghlan at gmail.com> wrote: > On 23 September 2013 18:45, Antoine Pitrou <solipsis at pitrou.net> wrote: > > Le Mon, 23 Sep 2013 18:17:51 +1000, > > Nick Coghlan <ncoghlan at gmail.com> a écrit : > >> > >> Here's what I suggest changing that error to: > >> > >> >>> del x > >> Unraisable exception suppressed when calling >> of <_main_.C object at 0x7f98b8b61538>> > >> Traceback (most recent call last): > >> File "", line 3, in del > >> RuntimeError: Going away now > > > > Why not simply "Exception automatically caught in > C.del> [...]" ? > > It only answers the "what" (i.e. the exception was automatically > caught), without addressing the "why" (i.e. because there wasn't > anything else useful the interpreter could do with it) Yes, but I agree with Greg that "unraisable" is wrong. After all, it was raised, and it can even be caught by the programmer (inside del).
The word doesn't literally mean the exception itself was unraisable. It means it was raised, we caught it and we're writing it to stderr because we can't raise it again.
The relevant C API function is just called "PyErr_WriteUnraisable", not "PyErr_WriteUnraisableButThatIsTechnicallyWrongSinceItWasAlreadyRaisedAndWeJustCaughtItAndAreNowReportingItToStdErr".
Cheers, Nick.
Regards Antoine.
Python-Dev mailing list Python-Dev at python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/ncoghlan%40gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20130924/3d93cb57/attachment.html>
- Previous message: [Python-Dev] Revert #12085 fix for __del__ attribute error message
- Next message: [Python-Dev] Revert #12085 fix for __del__ attribute error message
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]