[issue3112] implement PEP 3134 exception reporting

Adam Olsen report at bugs.python.org
Mon Jun 23 08:16:05 CEST 2008


Adam Olsen <rhamph at gmail.com> added the comment:

On Sun, Jun 22, 2008 at 2:56 PM, Antoine Pitrou <report at bugs.python.org> wrote:
> Le dimanche 22 juin 2008 à 20:40 +0000, Adam Olsen a écrit :
>> Passing in e.args is probably sufficient.
>
> I think it's very optimistic :-) Some exception objects can hold dynamic
> state which is simply not stored in the "args" tuple. See Twisted's
> Failure objects for an extreme example:
> http://twistedmatrix.com/trac/browser/trunk/twisted/python/failure.py
>
> (yes, it is used an an exception: see "raise self" in the trap() method)

Failure doesn't have an args tuple and doesn't subclass Exception (or
BaseException) - it already needs modification in 3.0.  It's heaped
full of complexity and implementation details.  I wouldn't be
surprised if your changes break it in subtle ways too.

In short, if forcing Failure to be rewritten is the only consequence
of using .args, it's an acceptable tradeoff of not corrupting
exception contexts.

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3112>
_______________________________________


More information about the Python-bugs-list mailing list