GNU bug report logs -
#50514
28.0.50; org inline call to python src block req C-g to break
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
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)
[Message part 2 (text/html, inline)]
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.