emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: Python session raises indentation error [9.2.6 (9.2.6-elpa @ /home/tobias/.emacs.d/elpa/org-9.2.6/)]
@ 2019-10-14 17:55 Tobias Müller
  2019-10-14 18:24 ` Tobias Müller
  0 siblings, 1 reply; 2+ messages in thread
From: Tobias Müller @ 2019-10-14 17:55 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 886 bytes --]

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.


[-- Attachment #1.2: Type: text/html, Size: 1270 bytes --]

[-- Attachment #2: info --]
[-- Type: application/octet-stream, Size: 251133 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Bug: Python session raises indentation error [9.2.6 (9.2.6-elpa @ /home/tobias/.emacs.d/elpa/org-9.2.6/)]
  2019-10-14 17:55 Bug: Python session raises indentation error [9.2.6 (9.2.6-elpa @ /home/tobias/.emacs.d/elpa/org-9.2.6/)] Tobias Müller
@ 2019-10-14 18:24 ` Tobias Müller
  0 siblings, 0 replies; 2+ messages in thread
From: Tobias Müller @ 2019-10-14 18:24 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1393 bytes --]

Dear, org-mode developer,

I was not aware of the fact, that new lines are special in interactive
mode and indicate the end of an indented block (I have just found out
about that in the babel documentation for python). Therefore the issue
which I have reported is probably not a bug but rather an expected
behavior. Please excuse me for positing a false bug report.

Best regards,
Tobias Müller.

Am 14.10.19 um 19:55 schrieb Tobias Müller:
>
> 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.
>

[-- Attachment #2: Type: text/html, Size: 2085 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-10-14 18:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-14 17:55 Bug: Python session raises indentation error [9.2.6 (9.2.6-elpa @ /home/tobias/.emacs.d/elpa/org-9.2.6/)] Tobias Müller
2019-10-14 18:24 ` Tobias Müller

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).