all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Barton, Mark" <Mark.Barton@disney.com>
To: Ihor Radchenko <yantar92@gmail.com>
Cc: "50514@debbugs.gnu.org" <50514@debbugs.gnu.org>,
	Mark Barton <mbarton98@gmail.com>,
	Lars Ingebrigtsen <larsi@gnus.org>,
	Augusto Stoffel <arstoffel@gmail.com>
Subject: bug#50514: 28.0.50; org inline call to python src block req C-g to break
Date: Sun, 28 Aug 2022 00:38:18 +0000	[thread overview]
Message-ID: <56BAC174-35F5-4ED6-8923-729B2DE20490@disney.com> (raw)
In-Reply-To: <9CADADD8-72C0-4951-9950-AC7149B339F4@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1416 bytes --]


I will work on getting more details this weekend. It looked like the buffer passed to org-babel-comint-wait-for-output was missing the "earmuffs". I tried adding the earmuffs with the org function for that but although I got passed that error, I messed up my python session and the following python blocks were not aware of the imports in the first block.

Mark



I tried something that was suggested last September 14th by Augusto Stoffel. I had not tried it because changing the sleep from 10 to 90 was my workaround.
One thing that might work is to block until the shell is ready with something like

    (run-python)
    (with-current-buffer *the-shell-buffer*
      (while (not python-shell--first-prompt-received)
        (accept-process-output (get-buffer-process (current-buffer)))))

The patch that is working for me now is:

modified   lisp/org/ob-python.el
@@ -198,7 +198,10 @@ org-babel-python-initiate-session-by-key
  (let ((python-shell-buffer-name
        (org-babel-python-without-earmuffs py-buffer)))
   (run-python cmd)
-  (sleep-for 0 10)))
+          (with-current-buffer py-buffer
+            (while (not python-shell--first-prompt-received)
+              (accept-process-output (get-buffer-process (current-buffer)))))
+          ))
        ((and (eq 'python-mode org-babel-python-mode)
      (fboundp 'py-shell)) ; python-mode.el
  (require 'python-mode)


[-- Attachment #2: Type: text/html, Size: 5009 bytes --]

  reply	other threads:[~2022-08-28  0:39 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-10 23:06 bug#50514: 28.0.50; org inline call to python src block req C-g to break Barton, Mark
2021-09-11 13:04 ` Lars Ingebrigtsen
2021-09-11 13:26 ` Augusto Stoffel
2021-09-12  6:22   ` Barton, Mark
2021-09-12  6:51     ` Augusto Stoffel
2021-09-12  8:27       ` Barton, Mark
2021-09-12  9:15         ` Augusto Stoffel
2021-09-12 17:00           ` Barton, Mark
2021-09-12 20:04             ` Barton, Mark
2021-09-14  6:42               ` Augusto Stoffel
2021-09-14 17:54                 ` Barton, Mark
2021-09-14 18:29                   ` Augusto Stoffel
2021-09-14 19:25                     ` Barton, Mark
2021-09-14 19:31                       ` Augusto Stoffel
2021-09-14 22:20                         ` Barton, Mark
2021-09-15  6:28                           ` Augusto Stoffel
2021-09-14 19:36                       ` Augusto Stoffel
2021-09-15  8:02                         ` Lars Ingebrigtsen
2022-08-25 15:12                           ` Lars Ingebrigtsen
2022-08-26 13:30                             ` Ihor Radchenko
2022-08-27 13:16                               ` Lars Ingebrigtsen
2022-08-27 14:11                                 ` Ihor Radchenko
2022-08-27 18:56                                   ` Barton, Mark
2022-08-27 21:31                                     ` Mark Barton
2022-08-28  0:38                                       ` Barton, Mark [this message]
2022-08-28  1:30                                         ` Ihor Radchenko
2022-08-28  1:56                                           ` Barton, Mark
2022-08-28  2:55                                             ` Ihor Radchenko

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56BAC174-35F5-4ED6-8923-729B2DE20490@disney.com \
    --to=mark.barton@disney.com \
    --cc=50514@debbugs.gnu.org \
    --cc=arstoffel@gmail.com \
    --cc=larsi@gnus.org \
    --cc=mbarton98@gmail.com \
    --cc=yantar92@gmail.com \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.