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

Can not show exception information correctly in IPython Console #2395

Closed
cheneave opened this issue May 3, 2015 · 4 comments · Fixed by #2547
Closed

Can not show exception information correctly in IPython Console #2395

cheneave opened this issue May 3, 2015 · 4 comments · Fixed by #2547

Comments

@cheneave
Copy link
Contributor

cheneave commented May 3, 2015

I'm using the dev version of Spyder, and ipython v3.1.0
When a ipython console is first started, it shows exception information correctly. For example, if I type in a undefined name, it shows a NameError.
But after I run a source file, even an empty source file, the console will only show

Traceback (most recent call last):

File "D:\Python\Python34\lib\site-packages\IPython\core\interactiveshell.py", line 3044, in run_code
except self.custom_exceptions:

TypeError: catching classes that do not inherit from BaseException is not allowed

When exception is thrown

@cheneave
Copy link
Contributor Author

cheneave commented May 3, 2015

I have found a very dirty workaround, just insert

self.custom_exceptions = tuple(
        [e for e in self.custom_exceptions if isinstance(e,BaseException)])

to line 3031 of Python34\lib\site-packages\IPython\core\interactiveshell.py

Is it because the method IPython handle custom exception is incompatible with python 3?

@ccordoba12
Copy link
Member

@cheneave, could you provide a step by step guide to reproduce this error?

@cheneave
Copy link
Contributor Author

cheneave commented May 5, 2015

  1. Create a empty script
  2. Run it by pressing F5
  3. type in any undefined variable such as "a"

It works properly before step 2

My version of python and ipython is

Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:44:40) [MSC v.1600 64 bit (AMD64)]
IPython 3.1.0 -- An enhanced Interactive Python.

Other packages required by spyder are all the latest version from pip3

@ccordoba12 ccordoba12 added this to the v2.3.5 milestone Jun 1, 2015
@ccordoba12
Copy link
Member

This is an IPython upstream problem, not an Spyder problem. I'll see what I can do about it.

@ccordoba12 ccordoba12 changed the title Can not show exception information correctly in Console Can not show exception information correctly in IPython Console (upstream error) Jun 9, 2015
@ccordoba12 ccordoba12 removed this from the v2.3.5 milestone Jun 9, 2015
takluyver added a commit to takluyver/spyder that referenced this issue Jul 16, 2015
@ccordoba12 ccordoba12 changed the title Can not show exception information correctly in IPython Console (upstream error) Can not show exception information correctly in IPython Console Jul 16, 2015
@ccordoba12 ccordoba12 added this to the v3.0 milestone Jul 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants