From mboxrd@z Thu Jan 1 00:00:00 1970 From: drymer Subject: Possible bug on ob-python.el Date: Thu, 29 Sep 2016 23:47:13 +0200 Message-ID: <20160929214713.zposl45ownsledjk@netbook> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="tkj4sb24ytd23gqx" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45725) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpjAt-0002X8-QO for emacs-orgmode@gnu.org; Thu, 29 Sep 2016 17:47:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bpjAp-00032s-Rn for emacs-orgmode@gnu.org; Thu, 29 Sep 2016 17:47:27 -0400 Received: from perdizione.investici.org ([94.23.50.208]:60779) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpjAp-00032K-FM for emacs-orgmode@gnu.org; Thu, 29 Sep 2016 17:47:23 -0400 Received: from [94.23.50.208] (perdizione [94.23.50.208]) (Authenticated sender: drymer@autistici.org) by localhost (Postfix) with ESMTPSA id 75CC1120177 for ; Thu, 29 Sep 2016 21:47:18 +0000 (UTC) Content-Disposition: inline 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: lista de correo de org-mode --tkj4sb24ytd23gqx Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, I'm not sure if it's a bug or if it's something I have missconfigured, but = there it goes. I'm using maint Org-mode version 8.3.6, release_8.3.6-4-g4835be.dirty. The = init file I'm using to debug is: #+BEGIN_SRC emacs-lisp (add-to-list 'load-path "~/.emacs.d/lisp/org-mode/lisp/") (add-to-list 'load-path "~/.emacs.d/elpa/python-mode-20160114.2307/") (require 'python-mode) (require 'org) (setq py-shell-name "/usr/local/bin/python3") (setq org-babel-python-mode 'python-mode) (org-babel-do-load-languages 'org-babel-load-languages '((python . t))) #+END_SRC I have a tree with the SESSION propertie set to "exercici". Under that tree= , two source blocks: #+BEGIN_SRC python import base64 #+END_SRC #+BEGIN_SRC python hex_string =3D "49276d206b696c6c696e6720796f757220627261696e206c696b6520612= 0706f69736f6e6f7573206d757368726f6f6d" print(base64.b64encode(bytes(hex_string))) #+END_SRC When evaluating the first one, in the message buffer appears: "if: Buffer *= Python-set* does not exist or has no process". Also, a buffer called "*ulb = Python3*" has appeared. What it seems to happen is that the "ulb" buffer is= created instead of the one called "Python-$sessionName". It only happens w= hen using python-mode set on 'org-babel-load-languages. I'll add the complete backtrace at the end of the e-mail. If I can add more= information, just ask for it. Thanks #+BEGIN_SRC emacs-lisp Debugger entered--Lisp error: (error "Buffer *Python-set* does not exist or= has no process") signal(error ("Buffer *Python-set* does not exist or has no process")) error("Buffer %s does not exist or has no process" "*Python-set*") (if (org-babel-comint-buffer-livep session) nil (error "Buffer %s does no= t exist or has no process" session)) (progn (if (org-babel-comint-buffer-livep session) nil (error "Buffer %s = does not exist or has no process" session)) (let ((save-match-data-internal= (match-data))) (unwind-protect (progn (save-current-buffer (set-buffer ses= sion) (let ((comint-input-filter ...)) (let* (... ... dangling-text raw) (g= oto-char ...) (let ... ... ...) (let ... ... ... ... ... ... ...) (while ..= =2E ...) (goto-char ...) (insert dangling-text) (if ... ...) (split-string = string-buffer comint-prompt-regexp))))) (set-match-data save-match-data-int= ernal (quote evaporate))))) (let ((tmp-file (org-babel-temp-file "python-"))) (progn (if (org-babel-c= omint-buffer-livep session) nil (error "Buffer %s does not exist or has no = process" session)) (let ((save-match-data-internal (match-data))) (unwind-p= rotect (progn (save-current-buffer (set-buffer session) (let (...) (let* ..= =2E ... ... ... ... ... ... ... ...)))) (set-match-data save-match-data-int= ernal (quote evaporate))))) (org-babel-eval-read-file tmp-file)) (cond ((eql result-type (quote output)) (mapconcat (function org-babel-tr= im) (butlast (progn (if (org-babel-comint-buffer-livep session) nil (error = "Buffer %s does not exist or has no process" session)) (let ((save-match-da= ta-internal ...)) (unwind-protect (progn ...) (set-match-data save-match-da= ta-internal ...)))) 2) "\n")) ((eql result-type (quote value)) (let ((tmp-f= ile (org-babel-temp-file "python-"))) (progn (if (org-babel-comint-buffer-l= ivep session) nil (error "Buffer %s does not exist or has no process" sessi= on)) (let ((save-match-data-internal (match-data))) (unwind-protect (progn = (save-current-buffer ... ...)) (set-match-data save-match-data-internal (qu= ote evaporate))))) (org-babel-eval-read-file tmp-file)))) (let* ((send-wait (function (lambda nil (comint-send-input nil t) (sleep-= for 0 5)))) (dump-last-value (function (lambda (tmp-file pp) (mapc (functio= n (lambda ... ... ...)) (if pp (list "import pprint" ...) (list ...)))))) (= input-body (function (lambda (body) (mapc (function (lambda ... ... ...)) (= split-string body "[=0D\n]")) (funcall send-wait)))) (results (cond ((eql r= esult-type (quote output)) (mapconcat (function org-babel-trim) (butlast (p= rogn ... ...) 2) "\n")) ((eql result-type (quote value)) (let ((tmp-file ..= =2E)) (progn (if ... nil ...) (let ... ...)) (org-babel-eval-read-file tmp-= file)))))) (if (string=3D (substring org-babel-python-eoe-indicator 1 -1) r= esults) nil (let ((--params result-params)) (if (member "none" --params) ni= l (if (or (member "scalar" --params) (member "verbatim" --params) (member "= html" --params) (member "code" --params) (member "pp" --params) (member "fi= le" --params) (and (or ... ... ... ...) (not ...))) results (org-babel-pyth= on-table-or-string results)))))) org-babel-python-evaluate-session("*Python-set*" "import base64" value ("= replace")) (if session (org-babel-python-evaluate-session session body result-type r= esult-params) (org-babel-python-evaluate-external-process body result-type = result-params preamble)) org-babel-python-evaluate("*Python-set*" "import base64" value ("replace"= ) nil) (let* ((session (org-babel-python-initiate-session (cdr (assoc :session p= arams)))) (result-params (cdr (assoc :result-params params))) (result-type = (cdr (assoc :result-type params))) (return-val (if (and (eq result-type (qu= ote value)) (not session)) (progn (cdr (assoc :return params))))) (preamble= (cdr (assoc :preamble params))) (org-babel-python-command (or (cdr (assoc = :python params)) org-babel-python-command)) (full-body (org-babel-expand-bo= dy:generic (concat body (if return-val (format "\nreturn %s" return-val) ""= )) params (org-babel-variable-assignments:python params))) (result (org-bab= el-python-evaluate session full-body result-type result-params preamble))) = (org-babel-reassemble-table result (org-babel-pick-name (cdr (assoc :colnam= e-names params)) (cdr (assoc :colnames params))) (org-babel-pick-name (cdr = (assoc :rowname-names params)) (cdr (assoc :rownames params))))) org-babel-execute:python("import base64" ((:comments . "") (:shebang . ""= ) (:cache . "no") (:padline . "") (:noweb . "no") (:tangle . "no") (:export= s . "code") (:results . "replace") (:hlines . "no") (:session . "set") (:re= sult-type . value) (:result-params "replace") (:rowname-names) (:colname-na= mes))) org-babel-execute-src-block(nil) org-babel-execute-src-block-maybe() org-babel-execute-maybe() org-babel-execute-safely-maybe() run-hook-with-args-until-success(org-babel-execute-safely-maybe) org-ctrl-c-ctrl-c(nil) funcall-interactively(org-ctrl-c-ctrl-c nil) call-interactively(org-ctrl-c-ctrl-c nil nil) command-execute(org-ctrl-c-ctrl-c) #+END_SRC --tkj4sb24ytd23gqx Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABCAAGBQJX7YvhAAoJEKMH1k1d39qte6wP/jRgAV3c7VC/ltIQ8TMupEec HzTEXNcHeQ1oQo9Uq4EBKkz4SidBgB39Uyif95NKBDrpCKvBQD+FrrX77Fs2+X65 6KvNuwXbbt9/ymivyxR8Z10FQX50BYIgVlY1PxYGv8zpwCa47RFgY/T1aYhDuKjD U7wyWYtzQdeanzU+BVxWy+5iHDhctMe/n3pyKIVcDHtzdnLEx7W68XogiJVuokN5 cfRQEz7q5FL0RfxgVWF3PMsMZtV0pplB/5UgPsvzFZ7AHLZlLAVbCrqY4jBebwcd yx9aeGf17bB/LFtwOBOYEz0wbY6wTxmzdrFNPugNQQAKtN2FOZffHjdNkbPdD3jx mnsLQqZQDcK7y8X6TkGX0A/bTysgmNR+nrrPLUmICFFAkl6HWek5SYDB2VlKOU2S VwHd61N7A2iMVQUtcRhEdMKNoqEssn2elRwka8PHC8wqjOHrNf6ob2G+AsbtPAmy 5h2/5HWCvqNr/P4iMmS52c4yHnjpMtPC8GX2ddU+vYTKUiIwey6RDeJOA4zrFsdO xOnoAhb2Pu/vzFKMlHk9a7I0E4bS5/jOwr7K9BRWanwJGhqe1Yux8OoPcu8QMOcf HCL5SeCS8jaCFCjGXznlYoF5bduEImbc+uPZD3FoWkqXRUOMXc4eTagFceAoipYt QTtqlgLkzCZp5MDbNfhA =BrQJ -----END PGP SIGNATURE----- --tkj4sb24ytd23gqx--