From mboxrd@z Thu Jan 1 00:00:00 1970 From: Brad Knotwell Subject: Python source block weirdness #2 Date: Sat, 30 Mar 2019 19:52:19 +0000 (UTC) Message-ID: <1686055329.5401063.1553975539952@mail.yahoo.com> References: <1686055329.5401063.1553975539952.ref@mail.yahoo.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_5401062_382582252.1553975539950" Return-path: Received: from eggs.gnu.org ([209.51.188.92]:56831) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hAK3h-0002sQ-0j for emacs-orgmode@gnu.org; Sat, 30 Mar 2019 15:54:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hAK3f-0005uA-BB for emacs-orgmode@gnu.org; Sat, 30 Mar 2019 15:54:28 -0400 Received: from sonic315-34.consmr.mail.gq1.yahoo.com ([98.137.65.58]:39719) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hAK3e-0005s6-WF for emacs-orgmode@gnu.org; Sat, 30 Mar 2019 15:54:27 -0400 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: Org-mode ------=_Part_5401062_382582252.1553975539950 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Good day all-- I've a similar problem that might hint at what's occurring. =C2=A0You can't= use an else or elif block in a python src block (might be session-specific= ). =C2=A0Looking through the commits, I wonder if=C2=A0 =C2=A0=C2=A01966d58= b253d0077025589c736b9223010682e17 Had some unintended consequences. Thx. --Brad #+NAME: works#+begin_src python :session broken :exports boths =3D True if s =3D=3D False:=C2=A0 =C2=A0 'result =3D %d' % 3 if s =3D=3D True:=C2=A0 =C2=A0 'result =3D %d' % 4#+end_src #+RESULTS: works Will it work again? #_NAME: sadness#+begin_src python :session broken2 :exports boths =3D True if s =3D=3D False:=C2=A0 =C2=A0 'result =3D %d' % 3else:=C2=A0 =C2=A0 'resu= lt =3D %d' % 4#+end_src It shouldn't be empty:#+RESULTS: sadness Output follows: ,----| s =3D True|=C2=A0| if s =3D=3D False:| =C2=A0 =C2=A0 'result =3D %d'= % 3|=C2=A0| if s =3D=3D True:| =C2=A0 =C2=A0 'result =3D %d' % 4`---- ,----| result =3D 4`---- Will it work again? #_NAME: sadness,----| s =3D True|=C2=A0| if s =3D=3D False:| =C2=A0 =C2=A0 = 'result =3D %d' % 3| else:| =C2=A0 =C2=A0 'result =3D %d' % 4`---- It shouldn't be empty: ------=_Part_5401062_382582252.1553975539950 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Good = day all--

I've a similar problem that might hint a= t what's occurring.  You can't use an else or elif block in a python s= rc block (might be session-specific).  Looking through the commits, I = wonder if
    1966d58b253d0077025589c736b92230= 10682e17

Had some unintended consequenc= es.

Thx.

--Brad

#+NAME: works
#+begin_src python :sess= ion broken :exports both
s =3D True

if s= =3D=3D False:
    'result =3D %d' % 3

if s =3D=3D True:
    'result =3D %d' % 4
#+end_src

#+RESULTS: works

Will it work again?

#_NAME: sadness
<= div>#+begin_src python :session broken2 :exports both
s =3D True<= /div>

if s =3D=3D False:
    'result= =3D %d' % 3
else:
    'result =3D %d' % 4
#+end_src

It shouldn't be empty:
#+RESULTS: sadness

Output follows:

=
,----
| s =3D True
<= div>| if s =3D=3D False:
|     'result =3D %d' % 3
| if s =3D=3D True:
|     'resu= lt =3D %d' % 4
`----

,----
| r= esult =3D 4
`----


Will it= work again?

#_NAME: sadness
,----
=
| s =3D True
| if s =3D=3D False:
|     'result =3D %d' % 3
| else:
|   =   'result =3D %d' % 4
`----

It shou= ldn't be empty:

= ------=_Part_5401062_382582252.1553975539950--