Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report tracebacks of interactively entered input #177

Closed
fperez opened this issue Oct 21, 2010 · 2 comments
Closed

Report tracebacks of interactively entered input #177

fperez opened this issue Oct 21, 2010 · 2 comments
Milestone

Comments

@fperez
Copy link
Member

fperez commented Oct 21, 2010

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
Copy link
Contributor

rkern commented Oct 21, 2010

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
Copy link
Member Author

fperez commented Oct 22, 2010

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 pushed a commit to markvoorhies/ipython that referenced this issue Apr 21, 2011
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 ipythongh-177.
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
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 ipythongh-177.
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants