Skip to content

Indentation failure with IPython #171

@rojizo

Description

@rojizo

Hi,

The problem is simple, when I run the following code in Jupyter/iPython notebook

····
for b in range(9):
····print(b)

(I marked with · the spaces as they are a very important part here) I got

  File "<ipython-input-2-97c81d27517d>", line 3
    print(b)
        ^
IndentationError: expected an indented block

But when I add or remove a space of the first line (the one with only spaces) it works fine... weird

I'm on Python3.4

{'commit_hash': '8b0eef4',
 'commit_source': 'installation',
 'default_encoding': 'UTF-8',
 'ipython_path': '/usr/local/lib/python3.4/site-packages/IPython',
 'ipython_version': '3.2.0',
 'os_name': 'posix',
 'platform': 'Darwin-14.3.0-x86_64-i386-64bit',
 'sys_executable': '/usr/local/opt/python3/bin/python3.4',
 'sys_platform': 'darwin',
 'sys_version': '3.4.3 (default, Feb 25 2015, 21:28:45) \n'
                '[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56)]'}

but the same happends with a 2.7 kernel

{'commit_hash': u'8b0eef4',
 'commit_source': 'installation',
 'default_encoding': 'UTF-8',
 'ipython_path': '/usr/local/lib/python2.7/site-packages/IPython',
 'ipython_version': '3.2.0',
 'os_name': 'posix',
 'platform': 'Darwin-14.3.0-x86_64-i386-64bit',
 'sys_executable': '/usr/local/opt/python/bin/python2.7',
 'sys_platform': 'darwin',
 'sys_version': '2.7.10 (default, May 28 2015, 10:51:46) \n[GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)]'}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions