unexpected indent in ipython 0.10.1

2019-05-14 15:04发布

问题:

I have a problem with ipython 0.10.1 in ubuntu 11.04 and python 2.7.1.

In previous versions of ipython indentation did not matter when working interactively.

Now instead any indented statement throws an exception:

In [1]:  a=3
------------------------------------------------------------
IndentationError: unexpected indent (<ipython console>, line 1)

this is really very annoying specifically when I am debugging and I want to paste some code from a script which is indented, and I am forced to undent every line.

Any hint welcome.

回答1:

This happens only when ipython is called with -wthread, I've just filed a bug about this.