Author ncoghlan
Recipients doerwalter, larry, ncoghlan, yselivanov
Date 2015-06-20.06:28:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1434781715.44.0.885055665732.issue24474@psf.upfronthosting.co.za>
In-reply-to
Content
This isn't a bug, as "raise exc from None" only hides *display* of the context, it doesn't lose the record of the context entirely.

This means Walter's display code is incorrect, as it isn't checking for __suppress_context__:

>>> import inspect
>>> try:
...     inspect.signature(lambda x:None).bind()
... except Exception as e:
...     exc = e
... 
>>> exc.__suppress_context__
True

Interestingly, neither PEP 409 *nor* PEP 415 capture the rationale for that design: retaining the full context data even when it's hidden by the default exception display routines means that you can still debug code that uses "raise X from None" inappropriately. (I thought there was an open RFE to make it easy to force the traceback module to ignore __suppress_context__ but if there is one, I can't find it)
History
Date User Action Args
2015-06-20 06:28:35ncoghlansetrecipients: + ncoghlan, doerwalter, larry, yselivanov
2015-06-20 06:28:35ncoghlansetmessageid: <1434781715.44.0.885055665732.issue24474@psf.upfronthosting.co.za>
2015-06-20 06:28:35ncoghlanlinkissue24474 messages
2015-06-20 06:28:34ncoghlancreate