Dear org-mode developer,

I have discovered the following issue with Python code-blocks: Using the :session header argument leads to errors of the type IndentationError: expected an indented block if the code block contains indented regions with empty lines. An example code-block which produces this kind of error is the following:

#+begin_src python :session
  for k in range(3):

      print(k)
#+end_src

removing the :session header argument leads to correct execution of the code block. The same is true if the :results output header argument is used.

If the blank line within the for-loop is removed the loop also gets executed correctly, however after executing the block the error NameError: name '_' is not defined is raised in the buffer of the Python session.

The generated info-file is attached to this mail.

Best regards,
Tobias Müller.