[IPython-dev] ipython1 saw exception transport and raising

Doug Jones dfj225@gmail....
Mon Aug 27 09:16:59 CDT 2007


Fernando,

First, sorry that it has taken me so long to respond.

Second, I have updated my ipython1 source and the behavior on my end
seems to be correct as well. I am testing with exceptions generated
from Boost.Python and now all information associated with the
exceptions seems to be displayed, including the correct traceback on
the engine.

Thank you,
~Doug

On 8/15/07, Fernando Perez <fperez.net@gmail.com> wrote:
> On 7/16/07, Doug Jones <dfj225@gmail.com> wrote:
>
> > As you see, some of the information that is part of the ArgumentError
> > is either not transported or not displayed. Unlike last time, I don't
> > really have any ideas as to why.
>
> OK, I think I got it finally... Please svn up and let us know.  Here's
> what I'm getting for simple tests:
>
> ZeroDivisionError: integer division or modulo by zero
> ***************************************************************************
> Exception in the IPython Engine.
>
> Engine action that caused the error:
>
> engine: 0
> method: execute(lines)
> lines =
> import os
> os.chdir('/home/fperez/ipython/test/ip1')
> import err
> err.bad()
> #abd snytxx
>
>
> Full traceback:
> ---------------------------------------------------------------------------
> ZeroDivisionError                         Traceback (most recent call last)
>
> /home/fperez/ipython/test/ip1/<string> in <module>()
>
> /home/fperez/ipython/test/ip1/err.py in bad()
>      14
>      15 def bad():
> ---> 16     1/0
>      17
>      18 #bad()
>
> ZeroDivisionError: integer division or modulo by zero
> ***************************************************************************
>
> WARNING: Failure executing file: <tst.py>
>
>
> Syntax errors are reported with a clumsy traceback:
>
> SyntaxError: invalid syntax (line 5)
> ***************************************************************************
> Exception in the IPython Engine.
>
> Engine action that caused the error:
>
> engine: 0
> method: execute(lines)
> lines =
> import os
> os.chdir('/home/fperez/ipython/test/ip1')
> import err
> err.bad()
> abd snytxx
>
>
> Full traceback:
> ---------------------------------------------------------------------------
> SyntaxError                               Traceback (most recent call last)
>
> /home/fperez/usr/lib/python2.5/site-packages/ipython1/core/interpreter.py
> in split_commands(self, python)
>     511         # Uncomment to help debug the ast tree
>     512         # for n in ast.node:
> --> 513         #     print n.lineno,'->',n
>     514
>     515         # Each separate command is available by iterating over
> ast.node. The
>
> /home/fperez/ipython/test/ip1/compiler/transformer.py in parse(buf, mode)
>      50
>      51
> ---> 52
>      53
>      54
>
> /home/fperez/ipython/test/ip1/compiler/transformer.py in parsesuite(self, text)
>     127
>     128
> --> 129
>     130
>     131
>
> SyntaxError: invalid syntax (line 5)
> ***************************************************************************
>
>
> WARNING: Failure executing file: <tst.py>
>
>
> But the info is really  all there.   It's just that managing traceback
> formatting across the network in this way is not particularly easy,
> and I'm a bit too fried now to do more...
>
> But at least now we are getting all the necessary info across, even if
> for syntax errors the report isn't the nicest.
>
> Cheers,
>
> f
>


More information about the IPython-dev mailing list