[IPython-dev] Anyone encountering IndentationError issues in the notebook?

Dmitry Chichkov dchichkov at gmail.com
Wed Aug 22 20:40:23 EDT 2012


Just confirmed, it is a problem of the latest codemirror (2.30.0).
Previous version (that is still bundled with notebook) don't have that
issue.

Can be reproduced by:
1. open  http://codemirror.net/mode/python/index.html
2. go to a first line, type <tab>print<enter>print<enter>

It would result in: a tab in front of a first print statement; 4 spaces in
front of the second.
This would result in IndentationError in python. And [I take it] ipython
just doesnt't show line number in this case.

Dmitry



On Wed, Aug 22, 2012 at 12:42 PM, Matthias BUSSONNIER <
bussonniermatthias at gmail.com> wrote:

>
> Le 22 août 2012 à 21:08, Dmitry Chichkov a écrit :
>
> > Hi,
> >
> > Wanted to check, if any of you are encountering any IndentationError
> issues with the notebook, or is it just me?
> >
> > I'm using development version of codemirror (corrected as per
> README-IPython.rst), and some times I'm encountering:
> >    IndentationError: expected an indented block
> >
> > 1. with no line numbers or other context information;
> > 2. caused by a mix of '4 spaces' / 'tabs', invisible in the editor;
> > 3. by itself caused by codemirror, which disregards a tabMode:"spaces"
> setting.
>
> Could you have a look at the javascript console when this append ?
> Do you have any traceback from javascript ?
> Which OS/browser are you using ?
>
> >
> > I've temporarily fixed it for myself, by converting all tabs into 4
> spaces during every save.
> > And saving/reloading the notebook [if I encounter that problem]. But I'm
> not entirely happy with that.
>
> We can activate the visible tab mode of code mirror, this would give you a
> visual indication of the fact that you have tabs inserted.
> Would it help ?
> You can open an issue on github if you want so that google better
> reference it.
>
> --
> Matthias
>
> >
> >
> > Anyone else hitting the same problem?
> >
> >
> > Thanks,
> > Dmitry
> > _______________________________________________
> > IPython-dev mailing list
> > IPython-dev at scipy.org
> > http://mail.scipy.org/mailman/listinfo/ipython-dev
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20120822/48b5a13a/attachment.html>


More information about the IPython-dev mailing list