[IPython-dev] Nicer display of exceptions with ipython1

Brian Granger ellisonbg.net at gmail.com
Sun Jul 20 17:52:05 EDT 2008

Yes, this is a generic problem that we have in IPython.kernel - all of
the user's exceptions get polluted with information from IPython

> It seems to me that an elegant way to resolve this problem would be to
> provide a callback to the interpreter to deal with traceback. I am
> looking at the traceback_trap and trying to figure out if what I want
> fits in this model or not, and I am not too sure it does. I think I want
> something more flexible.

In this case, I am not sure that a callback will really do what we
want.  One reason we have the option to allow the interpreter actually
raise the exception is that is how Python handles errors.  If we move
things to a callback, we sort of get stuck with our own non-exception
based error handling.  That would be very non-ideal.

I am not sure if it is possible, but I think the best solution is if
the traceback_trap can be smart and dynamically modify the traceback
to remove the unwanted information.  This is also needed even if the
interpreter is not raising the exception.  In that case, the
interpreter returns a dict that has the traceback as a string - with
the unwanted info as well.  Conclusion:  we need to figure out a way
of remove the unwanted info in the first place.

Also, isn't this what the callback would have to do anyway?  If so,
that logic should just be in the traceback_trap itself.



> Should I go ahead and implement a callback somewhere? And if so, where?
> In the traceback trap?

> Cheers,
> Gaël
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://lists.ipython.scipy.org/mailman/listinfo/ipython-dev

More information about the IPython-dev mailing list