From mboxrd@z Thu Jan 1 00:00:00 1970 From: Brad Knotwell Subject: python source block weirdness Date: Sat, 30 Mar 2019 18:39:50 +0000 (UTC) Message-ID: <1417096456.12477648.1553971190377@mail.yahoo.com> References: <1417096456.12477648.1553971190377.ref@mail.yahoo.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_12477647_791492892.1553971190374" Return-path: Received: from eggs.gnu.org ([209.51.188.92]:47495) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hAIvb-0006VY-4v for emacs-orgmode@gnu.org; Sat, 30 Mar 2019 14:42:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hAIvZ-0005n5-6y for emacs-orgmode@gnu.org; Sat, 30 Mar 2019 14:42:03 -0400 Received: from sonic301-49.consmr.mail.gq1.yahoo.com ([98.137.64.175]:45092) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hAIvY-0005m9-UP for emacs-orgmode@gnu.org; Sat, 30 Mar 2019 14:42:01 -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_12477647_791492892.1553971190374 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Good day all-- I've been reading on the mailing list and web about this but it's entirely = unclear to me what I need to do to make this work. =C2=A0I have a minimal e= xample below to show what I'm fighting. The raw/generated documents below show the problem clearly as the second bl= ock doesn't run correctly. =C2=A0Looking in the session, it receives an "un= expected indent" error which is unreasonable as I can paste that code into = Python's REPL and get an expected result. Looking around a bit, people were seeing this 4-5 years ago but I haven't b= een able to find anything since. =C2=A0Relevant version info: =C2=A09.2 org= mode, High Sierra OSX, and 2.7.10 Python. Thx. --Brad #+NAME: works#+begin_src python :session broken :exports boths =3D 3t =3D 4= 'result =3D %d' % (s + t)#+end_src Working result below:#+RESULTS: works #+NAME: surprise#+begin_src python :session broken :exports bothtry:=C2=A0 = =C2=A0 'hi'except:=C2=A0 =C2=A0 'there'#+end_src Surprising result (AKA nothing) below:#+RESULTS: surprise leads to the following output: ,----| s =3D 3| t =3D 4| 'result =3D %d' % (s + t)`---- Working result below:,----| result =3D 7`---- ,----| try:| =C2=A0 =C2=A0 'hi'| except:| =C2=A0 =C2=A0 'there'`---- Surprising result (AKA nothing) below: ------=_Part_12477647_791492892.1553971190374 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Good = day all--

I've been reading on the mailing list an= d web about this but it's entirely unclear to me what I need to do to make = this work.  I have a minimal example below to show what I'm fighting.<= /div>

The raw/generated documents below show the problem= clearly as the second block doesn't run correctly.  Looking in the se= ssion, it receives an "unexpected indent" error which is unreasonable as I = can paste that code into Python's REPL and get an expected result.

Looking around a bit, people were seeing this 4-5 years ag= o but I haven't been able to find anything since.  Relevant version in= fo:  9.2 orgmode, High Sierra OSX, and 2.7.10 Python.

Thx.

--Brad

#+NAME: works
#+begin_src python :session broken :exports = both
s =3D 3
t =3D 4
'result =3D %d' % (s + t= )
#+end_src

Working result below:
<= div>#+RESULTS: works


#+NAME: surpri= se
#+begin_src python :session broken :exports both
try= :
    'hi'
except:
    't= here'
#+end_src

Surprising result (AKA n= othing) below:
#+RESULTS: surprise

leads= to the following output:

,----
| s =3D 3
| t =3D 4
| 'result =3D %d' % (s + t)
`----

Working result below:
,----<= /div>
| result =3D 7
`----



,----
| try:
|     'hi'<= /div>
| except:
|     'there'
`----
=

Surprising result (AKA nothing) below:


------=_Part_12477647_791492892.1553971190374--