[IPython-dev] Shutdown __del__ methods bug

Fernando Perez fperez.net@gmail....
Sat Oct 16 11:16:05 CDT 2010


On Sat, Oct 16, 2010 at 8:29 AM, Thomas Kluyver <takowl@gmail.com> wrote:
> Unfortunately, this commit appears to have undone Fernando's fix for the bug
> with __del__ methods that I found:
> http://github.com/ipython/ipython/commit/239d2ed6f44c3f6511ee1e9069a5a1aee9c20f9c
>
> I can reproduce the bug in trunk. This also highlights that the doctest to
> catch it evidently doesn't do so. Running iptest IPython.core shows the
> error message on the console (among the ... of passed tests), but it doesn't
> fail. I'm not a console ninja, but could it be that the message goes to
> stderr, and the evaluation only checks stdout?

Ouch, thanks for catching that... Your intuition is indeed correct:
and the problem is that this exception is caught internally by python
itself, and not accessible to us by normal mechanisms.

We may try to hack either by redirecting sys.stderr to sys.stdout
temporarily, or replacing sys.excepthook.  If you can have a go at
these and find something interesting please let us know, I'm at a
conference this weekend with very limited time.

Cheers,

f


More information about the IPython-dev mailing list