From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?Gr=C3=A9goire?= Jadi Subject: Re: [PATCH] ob-python: Fix python session initialization Date: Wed, 30 Sep 2015 10:26:55 +0200 Message-ID: <87vbasxqgg.fsf@univ-nantes.fr> References: <87wpv8xrml.fsf@univ-nantes.fr> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47040) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZhCj6-0004Gg-Os for emacs-orgmode@gnu.org; Wed, 30 Sep 2015 04:27:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZhCj4-0004xa-4F for emacs-orgmode@gnu.org; Wed, 30 Sep 2015 04:27:00 -0400 Received: from smtptls2-lmb.cpub.univ-nantes.fr ([2001:660:7220:385:193:52:103:111]:53184 helo=smtp-tls.univ-nantes.fr) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZhCj3-0004xU-UL for emacs-orgmode@gnu.org; Wed, 30 Sep 2015 04:26:58 -0400 Received: from localhost (localhost [127.0.0.1]) by smtp-tls.univ-nantes.fr (Postfix) with ESMTP id F166240176C for ; Wed, 30 Sep 2015 10:26:56 +0200 (CEST) Received: from smtp-tls.univ-nantes.fr ([127.0.0.1]) by localhost (smtptls2-lmb.cpub.univ-nantes.fr [127.0.0.1]) (amavisd-new, port 10024) with LMTP id URdpB6eYDUIY for ; Wed, 30 Sep 2015 10:26:56 +0200 (CEST) Received: from localhost (ipcop.lina.sciences.univ-nantes.fr [193.52.105.131]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by smtp-tls.univ-nantes.fr (Postfix) with ESMTPSA id CA3DB40176D for ; Wed, 30 Sep 2015 10:26:56 +0200 (CEST) In-reply-to: <87wpv8xrml.fsf@univ-nantes.fr> 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: Orgmode --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Gr=C3=A9goire Jadi writes: > Hi, > > There is a bug in ob-python, the parameters aren't used to initialize > the session. Here is a patch that fixes it. Err, discard this. It's not enough to fix the bug since `org-babel-python-initiate-session' doesn't use the params either. I'll come back later with a correct patch (unless someone else is faster ;)). Sorry for the noise. Cheers > OK to push ? > > * lisp/ob-python.el (org-babel-execute:python): Send params to `org-babel= -python-initiate-session'. > > It was not possible to configure the sesssion with custom parameters. > For example, the python interpreter with :python >> BEGIN_SRC python :session my-session :python ipython > --- > lisp/ob-python.el | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lisp/ob-python.el b/lisp/ob-python.el > index 3a9b8f6..f2e6f66 100644 > --- a/lisp/ob-python.el > +++ b/lisp/ob-python.el > @@ -74,7 +74,7 @@ This will typically be either `python' or `python-mode'= ." > "Execute a block of Python code with Babel. > This function is called by `org-babel-execute-src-block'." > (let* ((session (org-babel-python-initiate-session > - (cdr (assoc :session params)))) > + (cdr (assoc :session params)) params)) > (result-params (cdr (assoc :result-params params))) > (result-type (cdr (assoc :result-type params))) > (return-val (when (and (eq result-type 'value) (not session)) > --=20 =2D-=20 Gr=C3=A9goire Jadi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJWC5zQAAoJEBNzVHcrZRiURWUQAKOkG9M/nF+uMyJmQ7M7tbjK MHeBDifJSDKqXB0pz+LgPk3TWpyFVB5kbXs55j5pAJg34wZUCD0hdgIzreMyKVyp 99qydxe8Hblxtu/94nPDvp5d3whiLA+VFAYG/UeHpKpEb02C2FurxLU0gwItff4H WT4vmVohxhtnY5n0rQFAVYSOB361/8nid4vkvjHpeG4e8pKfeJ8LJtrjxA9qoVF8 hOrCC0JPAZ3l7DauBv/hgygG8JQeiXDWeLmd2bpmB4JkzLzRZzLopYplUuK1Xk/c PkX2fqe6gyHqgM6VGmIxf4Vp0tRW+rAoTwWpSJVfvMBQfhpPf/RYmTaObrBj8mQ+ ctofRxojHeD34KCsTyzo2cTet3cVPAhLVJRytS7LQjoGouEQPcNchgsj0Gim9uQ1 XW6HA1+dB7SAYjYDLnXpXzvQOriHjQr37jfA6IuvR4C7doWhKP90yZnKiSi5fGBk yLsX4bGvDzBtfNITjTFUQxYxwSet1yFvUP2wl4O+ECDSESk3iW7LtmcqWatR6pBr Nwbj7i35JGGm4YNb5TdFGbHZuLytSMboNz3wYeScIaTSCGRlRd6uPxaQwz1EEb/a WgML4LJr/738OhT6qXBCZlUBKOMbnAWBBtWuzNJlMVWK9VNdO7yb+Ujc/KNRYtjc OpWiE2+mWlY3V87ZZrEM =MP9v -----END PGP SIGNATURE----- --=-=-=--