GNU bug report logs - #50514
28.0.50; org inline call to python src block req C-g to break

Previous Next

Package: org-mode;

Reported by: "Barton, Mark" <Mark.Barton <at> disney.com>

Date: Fri, 10 Sep 2021 23:13:01 UTC

Severity: normal

Full log


Message #53 received at 50514 <at> debbugs.gnu.org (full text, mbox):

From: Augusto Stoffel <arstoffel <at> gmail.com>
To: "Barton, Mark" <Mark.Barton <at> disney.com>
Cc: "50514 <at> debbugs.gnu.org" <50514 <at> debbugs.gnu.org>,
 Lars Ingebrigtsen <larsi <at> gnus.org>
Subject: Re: bug#50514: 28.0.50; org inline call to python src block req C-g
 to break
Date: Wed, 15 Sep 2021 08:28:07 +0200
On Tue, 14 Sep 2021 at 22:20, "Barton, Mark" <Mark.Barton <at> disney.com> wrote:

>  On Sep 14, 2021, at 12:31 PM, Augusto Stoffel <arstoffel <at> gmail.com> wrote:
>
>  Great.  Then we'll fix the spurious line break problem, which is indeed
>  on the Emacs side.  But the other is due to ob-python, which may send
>  code to the interpreter before the first prompt is printed (this can be
>  checked through the variable 'python-shell--first-prompt-received').
>
>  Since I don't use org-babel, I'm afraid I can't help with that part…
>
> So I found if I extend the sleep-for in ob-python from 10 ms to 90 ms, my initialization problem is
> “fixed”. I’m not sure why it would take longer than it did before the changes. Possibly an
> interaction with the antivirus software???

This was probably a problem all along, but went unnoticed until now
because 'python-shell-send-string' used to be simpler.

> I have not tried other values, but may be there is a better
> method for ob-python to determine it is safe than using a sleep-for.

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)))))






This bug report was last modified 2 years and 292 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.