From: stardiviner <numbchild@gmail.com>
To: Org Mode <emacs-orgmode@gnu.org>
Subject: [PATCH] Fix ob-python.el initiate session error with py-shell
Date: Tue, 18 Feb 2020 20:55:41 +0800 [thread overview]
Message-ID: <877e0kjbqq.fsf@gmail.com> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 504 bytes --]
When I have a python src block like this:
#+begin_src python :session "test" :results output
print("hello, world")
#+end_src
It will report session error.
This minor patch should fixed ~py-shell~ initiate Python session issue.
--
[ stardiviner ]
I try to make every word tell the meaning what I want to express.
Blog: https://stardiviner.github.io/
IRC(freenode): stardiviner, Matrix: stardiviner
GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-lisp-ob-python.el-org-babel-python-initiate-session-.patch --]
[-- Type: text/x-patch, Size: 1100 bytes --]
From fa39b7f3ad8aafe0fcebb27c5f695edf08820884 Mon Sep 17 00:00:00 2001
From: stardiviner <numbchild@gmail.com>
Date: Tue, 18 Feb 2020 20:52:32 +0800
Subject: [PATCH] * lisp/ob-python.el
(org-babel-python-initiate-session-by-key):
fix ob-python.el initiate session issue.
---
lisp/ob-python.el | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lisp/ob-python.el b/lisp/ob-python.el
index de718b04b..f67acf2f9 100644
--- a/lisp/ob-python.el
+++ b/lisp/ob-python.el
@@ -207,8 +207,8 @@ (defun org-babel-python-initiate-session-by-key (&optional session)
"^\\*\\([^*]+\\)\\*$" "\\1" python-buffer)
(concat "Python-" (symbol-name session))))
(py-which-bufname bufname))
- (py-shell)
- (setq python-buffer (org-babel-python-with-earmuffs bufname))))
+ (setq python-buffer (org-babel-python-with-earmuffs bufname))
+ (py-shell nil nil t org-babel-python-command python-buffer nil nil t nil)))
(t
(error "No function available for running an inferior Python")))
(setq org-babel-python-buffers
--
2.25.0
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 515 bytes --]
next reply other threads:[~2020-02-18 12:55 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-18 12:55 stardiviner [this message]
2020-02-18 13:07 ` [PATCH] Fix ob-python.el initiate session error with py-shell Bastien
2020-02-18 17:07 ` Jack Kamm
2020-02-18 17:18 ` Jack Kamm
2020-02-18 20:23 ` Bastien
2020-02-19 7:38 ` numbchild
2020-02-19 15:51 ` Jack Kamm
2020-02-19 16:03 ` Bastien
2020-02-20 5:45 ` stardiviner
2020-02-20 16:26 ` Andreas Röhler
2020-02-20 17:46 ` Bastien
2020-02-20 18:51 ` Jack Kamm
2020-02-20 19:08 ` Bastien
2020-02-22 14:28 ` stardiviner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877e0kjbqq.fsf@gmail.com \
--to=numbchild@gmail.com \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).