From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id oC3bLnaNCmMN/wAAbAwnHQ (envelope-from ) for ; Sat, 27 Aug 2022 23:32:38 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 2FYlLnaNCmNaYAAAG6o9tA (envelope-from ) for ; Sat, 27 Aug 2022 23:32:38 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 2D40694DA for ; Sat, 27 Aug 2022 23:32:38 +0200 (CEST) Received: from localhost ([::1]:48394 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oS3Px-0007R5-1g for larch@yhetil.org; Sat, 27 Aug 2022 17:32:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48712) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oS3PP-0007Qu-3B for emacs-orgmode@gnu.org; Sat, 27 Aug 2022 17:32:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39231) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oS3PO-0006rV-M8 for emacs-orgmode@gnu.org; Sat, 27 Aug 2022 17:32:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oS3PO-0005yJ-GM for emacs-orgmode@gnu.org; Sat, 27 Aug 2022 17:32:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#50514: 28.0.50; org inline call to python src block req C-g to break Resent-From: Mark Barton Original-Sender: "Debbugs-submit" Resent-CC: emacs-orgmode@gnu.org Resent-Date: Sat, 27 Aug 2022 21:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50514 X-GNU-PR-Package: org-mode X-GNU-PR-Keywords: To: "Barton, Mark" Cc: 50514@debbugs.gnu.org, Lars Ingebrigtsen , Augusto Stoffel , Ihor Radchenko Received: via spool by 50514-submit@debbugs.gnu.org id=B50514.166163590422928 (code B ref 50514); Sat, 27 Aug 2022 21:32:02 +0000 Received: (at 50514) by debbugs.gnu.org; 27 Aug 2022 21:31:44 +0000 Received: from localhost ([127.0.0.1]:57212 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oS3P5-0005xj-Fr for submit@debbugs.gnu.org; Sat, 27 Aug 2022 17:31:44 -0400 Received: from mail-pj1-f48.google.com ([209.85.216.48]:52822) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oS3P3-0005xU-Dy for 50514@debbugs.gnu.org; Sat, 27 Aug 2022 17:31:42 -0400 Received: by mail-pj1-f48.google.com with SMTP id bg22so4639140pjb.2 for <50514@debbugs.gnu.org>; Sat, 27 Aug 2022 14:31:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version :from:content-transfer-encoding:from:to:cc; bh=t+PGs3IXXVcbsDPRq1g/lqJNQ8X7pJIWbA+bZS9RnCw=; b=O8pwcCbWWQhliTB2hr/t63Jrg2QjLUoeZhRA1QkYm9QQxisRoHgdr0IVfsseIbbOkR 5Yl7FZbFQetRCH9pYAhtVdsPkw2oD3R/y/EUVpCgboUmCvz9RRvJ3/3/YR8atzb0gonI o0Iy3aTIvnI7TFuqcH8kVi3MOxlTNsIG9pJ70xEHrpZJu6eTy+G+aFZGpmTtWWUnG34K ZK7zn/3NPCPXPOsACIqveuSKHpFsyrmQUo9fu8g8yM3qhbQEbWZnA4cwbrboHvKY6cFM 1r7AyoqSuN9Nk4a1iTAmH0si6+JXeZ07AHqLAS9BRPvuEVtqamTgvJ62lFT3dghm7kYh UlwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version :from:content-transfer-encoding:x-gm-message-state:from:to:cc; bh=t+PGs3IXXVcbsDPRq1g/lqJNQ8X7pJIWbA+bZS9RnCw=; b=dAape7/imu96WVMllz/MEzg3llA5LsloDkpGL6x4qPBTA7e4lONwGYdvuRKt+0EW9+ rh6Rm74HLc9/qfShjAyShKO9RyqHizmuhN66f+65ZvbwOsLqRB3dkNAiXKsry5RLEGJZ gw/IzqTzveNqyGg3y9ndLgTLklPZvVg45dTBsgF1xsXv6abTn6TOoM4adxYAK5Cj+l2L a+GJl6QgOA+8UCV7uR5Z092GSR93CUTRR/WVRf+/jaWzbnrxqk9BCAM3XwcOomW3uB9O jdjdOhmN8aZkNcytct4vphaZGcRRdUIp+o8Dj+wXTYfGgFaEhMf/KGdRDkC59lmntnHq JBuA== X-Gm-Message-State: ACgBeo033NQb3z3LtlercJKsJNzc2n967O1ArsPqmKsaBU+ls8+iE6aL /L9OeONmdFOp0UuDXe3ePCM= X-Google-Smtp-Source: AA6agR4dbVF0VU92uHSW+JgdypKK3/86FdpPjOYLYTGYIK4dN7hSEcfDt3XKvjL608NTyIzy2hhGyA== X-Received: by 2002:a17:90a:bd05:b0:1fb:c4b6:a83c with SMTP id y5-20020a17090abd0500b001fbc4b6a83cmr10624952pjr.142.1661635895642; Sat, 27 Aug 2022 14:31:35 -0700 (PDT) Received: from smtpclient.apple (2603-8001-7a00-01a0-d848-5d54-a2cc-c1f1.res6.spectrum.com. [2603:8001:7a00:1a0:d848:5d54:a2cc:c1f1]) by smtp.gmail.com with ESMTPSA id a9-20020aa78e89000000b005379fb50ff0sm4187535pfr.50.2022.08.27.14.31.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 27 Aug 2022 14:31:34 -0700 (PDT) Content-Type: multipart/alternative; boundary=Apple-Mail-5290938F-EBF6-44A6-80D7-0110DDC3D877 Content-Transfer-Encoding: 7bit From: Mark Barton Mime-Version: 1.0 (1.0) Date: Sat, 27 Aug 2022 14:31:33 -0700 Message-Id: <9CADADD8-72C0-4951-9950-AC7149B339F4@gmail.com> References: In-Reply-To: X-Mailer: iPhone Mail (19G82) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: emacs-orgmode@gnu.org List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1661635958; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=t+PGs3IXXVcbsDPRq1g/lqJNQ8X7pJIWbA+bZS9RnCw=; b=pEfXUJc7hgZ5KiGPPew4PbDvqNgJfY3l39Dmxj1mz9oh/HlyQ9Bn5pnAuT3kMTjmpq17Sx wOh1R0OdWp57dDmn+1nlkUPVfNYvFyW3D0qjjzH0tNC/Bel/xwPpeodCaYXnPP7jlGnNjX k7LoJJ5iM3ysaQL5J4P/pBwlTLN4HYZfLhoJ5shiKNJnZiG4s/0czt+lec2j2XyviMZah9 a/+Kq9orTTWBYJjQdEePIrT7AQqc4tBicCxeh6O0wm5xk83vI1H0+5x421iXz/7E+GLoE3 64/hOL0fyy9Fwyq2gx9qJtubvjbyP07yzXaDiDG0ClLnZaJ/XrGG2weiU2hD1A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1661635958; a=rsa-sha256; cv=none; b=CYo9saLn3I5ZnAcwRZZRXZ7GjAaxvkOvRR4Xt2SITJOQiNvokLT2uWXrb1TL4YZpiwneQ4 l2UhTIaoLkY5mDZ+8L5QdTUziL6OiH7edQpt6f3Q0bI9XJrPdVPOhz/GBvGYLmjUzvYzf/ aRCN32z/JOz5nqKRV7m1pI+Knl6I7+zMQW/O1A2lX7IftpGWN6umYBjAmT9yq3acMjSL04 3RZj7toZ9IF9SaMgCgjB6wsjlt31Oec3VxGiRXAA+vRdTqQUa7re4WpjJfBR8WuQT3EytZ Qia38i74D+kUX4lhPICXewflVjfZ/cuML/9ETTJZ7pYQdH1915Q2ge2DxomuVw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=O8pwcCbW; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 7.70 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=O8pwcCbW; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 2D40694DA X-Spam-Score: 7.70 X-Migadu-Scanner: scn0.migadu.com X-TUID: /0HPc7r5z7bL --Apple-Mail-5290938F-EBF6-44A6-80D7-0110DDC3D877 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable > On Aug 27, 2022, at 11:59 AM, Barton, Mark wrote:= >=20 > =EF=BB=BF=20 >=20 >> On Aug 27, 2022, at 7:11 AM, Ihor Radchenko wrote: >>=20 >> --- >> lisp/ob-python.el | 8 ++++---- >> 1 file changed, 4 insertions(+), 4 deletions(-) >>=20 >> diff --git a/lisp/ob-python.el b/lisp/ob-python.el >> index 932aca08e..2ad907bd8 100644 >> --- a/lisp/ob-python.el >> +++ b/lisp/ob-python.el >> @@ -197,8 +197,7 @@ (defun org-babel-python-initiate-session-by-key (&opt= ional session) >> (setq py-buffer (org-babel-python-with-earmuffs session))) >> (let ((python-shell-buffer-name >> (org-babel-python-without-earmuffs py-buffer))) >> - (run-python cmd) >> - (sleep-for 0 10))) >> + (run-python cmd))) >> ((and (eq 'python-mode org-babel-python-mode) >> (fboundp 'py-shell)) ; python-mode.el >> (require 'python-mode) >> @@ -225,8 +224,9 @@ (defun org-babel-python-initiate-session-by-key (&opt= ional session) >> (defun org-babel-python-initiate-session (&optional session _params) >> "Create a session named SESSION according to PARAMS." >> (unless (string=3D session "none") >> - (org-babel-python-session-buffer >> - (org-babel-python-initiate-session-by-key session)))) >> + (let ((session (org-babel-python-session-buffer >> + (org-babel-python-initiate-session-by-key session)))= )) >> + (org-babel-comint-wait-for-output session))) >>=20 >> (defvar org-babel-python-eoe-indicator "org_babel_python_eoe" >> "A string to indicate that evaluation has completed.") >> --=20 >> 2.35.1 >=20 > I get the following in the Messages: > org-babel-comint-wait-for-output: Buffer python-chain does not exist or ha= s no process >=20 > Note that python-chain is the name of my session passed to the python bloc= ks as shown in the following line within my org file. >=20 > #+PROPERTY: header-args:python :session python-chain :exports results :res= ults raw file :file-ext table >=20 > Thanks, >=20 > Mark >=20 I will work on getting more details this weekend. It looked like the buffer p= assed to org-babel-comint-wait-for-output was missing the "earmuffs". I trie= d adding the earmuffs with the org function for that but although I got pass= ed that error, I messed up my python session and the following python blocks= were not aware of the imports in the first block. Mark =20= --Apple-Mail-5290938F-EBF6-44A6-80D7-0110DDC3D877 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable

On Aug 27, 2022, at 11= :59 AM, Barton, Mark <Mark.Barton@disney.com> wrote:

=EF=BB=BF =

On Aug 27, 2022, at 7:11 AM, Ihor Radchenko <yantar92@gmail.com> wrote:

---
lisp/ob-python.el | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lisp/ob-python.e= l b/lisp/ob-python.el
index 932aca08e..2= ad907bd8 100644
--- a/lisp/ob-python.el<= /span>
+++ b/lisp/ob-python.el
@@ -197,8 +197,7 @@ (defun org-babel-python-initiate-sess= ion-by-key (&optional session)
  (setq py-buffer (org-babel-python-with-ea= rmuffs session)))
(let ((python-shell-buffer-name
     =   (org-babel-python-without-earmuffs py-buffer)))
-=   (run-python c= md)
-   (sleep-for 0 10)))
+
  (run-python cmd)))
       ((and (eq 'python-m= ode org-babel-python-mode)
     (fboundp 'py-shell)) ; python-mo= de.el
(require 'python-mode)
@@ -225,8 +224,9 @@ (defun org-babel-python-initiate-session-by-key (&= ;optional session)
(defun org-babel-pytho= n-initiate-session (&optional session _params)
  "Create a session named SESSION according to PARAMS.= "
  (unless (string=3D session= "none")
-    (org-babel-= python-session-buffer
-   &nbs= p; (org-babel-python-initiate-session-by-key session))))
+    (let ((session (org-babel-python-s= ession-buffer
+     =             &nbs= p;  (org-babel-python-initiate-session-by-key session)))))<= br style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12= px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-= spacing: normal; text-align: start; text-indent: 0px; text-transform: none; w= hite-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-= decoration: none;" class=3D"">+    (org-babel-comint-wait-for-o= utput session)))

(defvar org-babel-python-eoe-indicator "org_babel_python_eoe"<= br style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12= px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-= spacing: normal; text-align: start; text-indent: 0px; text-transform: none; w= hite-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-= decoration: none;" class=3D"">  "A string to indicate that evaluatio= n has completed.")
-- 
2.35.1

I get the follow= ing in the Messages:
org-babel-comint-wait-for-output: B= uffer python-chain does not exist or has no process
Note that python-chain is the name of my s= ession passed to the python blocks as shown in the following line within my o= rg file.

#+PROPERTY: header-args:python :session python-chain :exports results= :results raw file :file-ext table

Thanks,

Mark

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

Mar= k

 
= --Apple-Mail-5290938F-EBF6-44A6-80D7-0110DDC3D877--