Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Report tracebacks of interactively entered input #177

Closed
fperez opened this Issue · 2 comments

2 participants

@fperez
Owner

This has been an issue always, but it becomes far more critical with a client like the Qt console that can handle complex multiline input. Python by default won't give a traceback of interactively entered input, which means that errors on complex multiline input are very hard to debug.

At the old terminal console, we typically used %run for complex codes, so tracebacks can be read from a file. But now we're typing complex codes even at the terminal, so we need to have good tracebacks there.

Approach: create a scratch file with the last input being executed as the first step of exception traceback construction. This will allow the python exception machinery to find the information it wants.

The name of the scratch file should be constant through the life of the kernel, so that it's hardcoded in the compile() calls.

@rkern

There's no need to make an actual file. You just need to fill the linecache appropriately. Here is some code I've written before that does this.

http://gist.github.com/637806

@fperez
Owner

Complete implementation of interactive traceback support.

Ever since IPython started, we've had no proper tracebacks for
interactively entered code. The terminal version was fairly
uncomfortable for more than just a few lines of code, so this was
never too big of a deal. But the new architecture allows clients with
complex multiline input, and having proper tracebacks becomes now
critical for real-world use.

Thanks to Robert Kern for key implementation ideas and original patch.

Closed by c94126c.

@markvoorhies markvoorhies referenced this issue from a commit in markvoorhies/ipython
@fperez fperez Complete implementation of interactive traceback support.
Ever since IPython started, we've had no proper tracebacks for
interactively entered code.  The terminal version was fairly
uncomfortable for more than just a few lines of code, so this was
never too big of a deal.  But the new architecture allows clients with
complex multiline input, and having proper tracebacks becomes now
critical for real-world use.

Thanks to Robert Kern for key implementation ideas and original patch.

Closes gh-177.
c94126c
@fperez fperez referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@damianavila damianavila referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@mattvonrocketstein mattvonrocketstein referenced this issue from a commit in mattvonrocketstein/ipython
@fperez fperez Complete implementation of interactive traceback support.
Ever since IPython started, we've had no proper tracebacks for
interactively entered code.  The terminal version was fairly
uncomfortable for more than just a few lines of code, so this was
never too big of a deal.  But the new architecture allows clients with
complex multiline input, and having proper tracebacks becomes now
critical for real-world use.

Thanks to Robert Kern for key implementation ideas and original patch.

Closes gh-177.
9c95ec5
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.