Show message about %paste magic on an IndentationError #576

merged 3 commits into from Jul 13, 2011


None yet

3 participants

IPython member

Show message about %paste magic on an IndentationError from code in the prompt.

Only when we parse code from the prompt, so it won't show up if there's an IndentationError from code that's imported.

Sort of closes #572.

@takluyver takluyver merged commit ebdbac3 into ipython:master Jul 13, 2011

This is a very cryptic message to me:

unexpected indent (<ipython-input-18-6ff15c9a0bad>, line 1)

If you want to paste code into IPython, try the %paste magic function.

The documentation also does not contain information about any %paste magic function.

I would prefer the old behavior back, where pasting indented code just worked.

IPython member

%paste is only defined for the terminal frontend, which doesn't appear to be listed in the API docs (I'm not sure why). But there's not much to document - just enter %paste.

It's quite tricky to handle indented code correctly at the terminal, where we're trying to do autoindentation at the same time. Pasting at the Qt console works perfectly. I'd like to see it work better in the terminal, but it's probably not high priority for any of the developers at the moment.


+1 for fixing this. Qt console doesn't build properly on my box and this feels like a pretty big regression to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment