From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?Tobias_M=c3=bcller?= Subject: Re: Bug: Python session raises indentation error [9.2.6 (9.2.6-elpa @ /home/tobias/.emacs.d/elpa/org-9.2.6/)] Date: Mon, 14 Oct 2019 20:24:27 +0200 Message-ID: <611c2df4-dd48-e0f3-aef9-72f04d41619a@gmx.de> References: <8bc94355-0c14-4b43-b060-7dd4db42f32b@gmx.de> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------49E1A6EB5C6F7EE9A87FF96B" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:57241) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iK51E-0002ZH-95 for emacs-orgmode@gnu.org; Mon, 14 Oct 2019 14:24:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iK51C-0007h6-Tk for emacs-orgmode@gnu.org; Mon, 14 Oct 2019 14:24:32 -0400 Received: from mout.gmx.net ([212.227.15.15]:40095) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iK51C-0007gg-Fx for emacs-orgmode@gnu.org; Mon, 14 Oct 2019 14:24:30 -0400 Received: from [192.168.178.29] ([82.207.236.97]) by mail.gmx.com (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MybGh-1i89jN2M2P-00ywBk for ; Mon, 14 Oct 2019 20:24:28 +0200 In-Reply-To: <8bc94355-0c14-4b43-b060-7dd4db42f32b@gmx.de> Content-Language: en-US List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org This is a multi-part message in MIME format. --------------49E1A6EB5C6F7EE9A87FF96B Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable 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=C3=BCller. Am 14.10.19 um 19:55 schrieb Tobias M=C3=BCller: > > 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=C3=BCller. > --------------49E1A6EB5C6F7EE9A87FF96B Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable

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=C3=BCller.

Am 14.10.19 um 19:55 schrieb Tobias M=C3=BCller:

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=C3=BCller.

--------------49E1A6EB5C6F7EE9A87FF96B--