From mboxrd@z Thu Jan 1 00:00:00 1970 From: Instructor account Subject: Re: odd/unexpected behavior with Python src blocks Date: Mon, 29 Sep 2014 11:56:06 -0400 Message-ID: References: <87oatzkygu.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40491) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XYdJE-0008JC-Q8 for emacs-orgmode@gnu.org; Mon, 29 Sep 2014 11:56:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XYdJ8-0000BR-Mu for emacs-orgmode@gnu.org; Mon, 29 Sep 2014 11:56:20 -0400 Received: from smtp.andrew.cmu.edu ([128.2.157.38]:40390) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XYdJ8-0000AY-Ix for emacs-orgmode@gnu.org; Mon, 29 Sep 2014 11:56:14 -0400 Received: from johns-air.wv.cc.cmu.edu (KITCHIN-TIMEMACHINE.CHEME.CMU.EDU [128.2.54.215]) (user=jkitchin mech=PLAIN (0 bits)) by smtp.andrew.cmu.edu (8.14.8/8.14.8) with ESMTP id s8TFu72n012228 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT) for ; Mon, 29 Sep 2014 11:56:07 -0400 In-Reply-To: <87oatzkygu.fsf@gmail.com> (Aaron Ecay's message of "Sun, 28 Sep 2014 21:27:29 -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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Indeed, this passes by org-babel because stderr is not captured, and scipy does what you suggest. I guess this happens inside compiled c/Fortran code since there is nothing catching it in the odeint python function doing that. Thanks, I will try to bring it up on the scipy list.=20 Aaron Ecay writes: > Hi John, > > 2014ko irailak 28an, John Kitchin-ek idatzi zuen: > > [...] > >> I am not sure why this happens, but it seems like incorrect behavior to >> me. > > In the first case, python exits with a non-zero exit code, whereas in > the second it exits with a zero code (i.e. successful exit), and prints > the matrix-thing [[1.], [1.]] to stdout. It looks like scipy traps the > NameErrors and prints them to stderr, but continues its computation > regardless. > > I=E2=80=99d say babel is performing as desired here, but scipy sadly isn= =E2=80=99t > reporting its errors in the standard way (by a nonzero exit, which I > think would happen automatically if the NameErrors made it to the top > level of the stack without being caught). --=20 ----------------------------------- John Kitchin Professor Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 http://kitchingroup.cheme.cmu.edu