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 +KqzK1C5CmNnUgEAbAwnHQ (envelope-from ) for ; Sun, 28 Aug 2022 02:39:44 +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 SE3+KlC5CmMARwAAG6o9tA (envelope-from ) for ; Sun, 28 Aug 2022 02:39:44 +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 F3679C2A5 for ; Sun, 28 Aug 2022 02:39:43 +0200 (CEST) Received: from localhost ([::1]:59294 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oS6L0-0001t7-Ha for larch@yhetil.org; Sat, 27 Aug 2022 20:39:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42436) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oS6KO-0001re-Hb for emacs-orgmode@gnu.org; Sat, 27 Aug 2022 20:39:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39323) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oS6KM-0006YG-O7 for emacs-orgmode@gnu.org; Sat, 27 Aug 2022 20:39:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oS6KM-0002C6-9C for emacs-orgmode@gnu.org; Sat, 27 Aug 2022 20:39: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: "Barton, Mark" Original-Sender: "Debbugs-submit" Resent-CC: emacs-orgmode@gnu.org Resent-Date: Sun, 28 Aug 2022 00:39: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: Ihor Radchenko Cc: "50514@debbugs.gnu.org" <50514@debbugs.gnu.org>, Mark Barton , Lars Ingebrigtsen , Augusto Stoffel Received: via spool by 50514-submit@debbugs.gnu.org id=B50514.16616471098394 (code B ref 50514); Sun, 28 Aug 2022 00:39:02 +0000 Received: (at 50514) by debbugs.gnu.org; 28 Aug 2022 00:38:29 +0000 Received: from localhost ([127.0.0.1]:57305 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oS6Jp-0002BJ-9V for submit@debbugs.gnu.org; Sat, 27 Aug 2022 20:38:29 -0400 Received: from mail-dm6nam12on2127.outbound.protection.outlook.com ([40.107.243.127]:47585 helo=NAM12-DM6-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oS6Jm-0002B6-Jb for 50514@debbugs.gnu.org; Sat, 27 Aug 2022 20:38:27 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HuiV4f6ekokjDOddUucalm5fNYhrukT/8kb7qm5v+UA/47UvSJIvb1k3MtpKyDuaWox74CxAQAznK5Vbc1jKuHOgYBaqEwMr16Si8GWGt8x6Ob9p99SRLzqtHfWQIdxMEuF50J0h+h5XqxL0oteAeVqGJYXRDHLKfou5ReSIXysC0P6HazAXnUB9hbLrbEEAuEAqXZ/KNkHf9t5+Oiz1fsZO/DmKVwZ6DxV0NxxAsMlS7o5UEgFj0JtOSJO/WpRqvCFgkxaM69Msn5xv2b6Wj1+kUwkGnsTME1SSv/SRHM/bmMduJXqB+4fg4AAvAZZ3dw1Vf+JtHLgXPjgnUCagmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WGfhSs2zP4gzxC9fLUVTW3ksh0wjN3YbvAteuuHV8Zk=; b=Ldc7Rb0iUkkg+5pzQGBLnNSQKy6Q7Wfk72IPqhCWqLZ9NY3Mu83zuq/HSPNDhYPxkpw221h4zYryO2Xx1wnamDb5Fe8qZmvC13J1WBjXuI2caQZyBBEXRbjUYTUIuHCA5nK0iTTU7qyLB5JakPJKKRJ2ZmU6fAheabxf8SCMVfPeIkQ83WpDCjjkg4LXumizRj1CEkSBtPWBK+QDNunQULzzZJjspEb1mcc8Qb3o8RP6x5zuruVfGPUBgA+fZZRIYCaXba17OnOCZfTHkvsYvgcRdnHGHbclL6WUlBq1iZzJ2arQ+j1Jo1/GCkm0che1diBqZ0mHaI26+R9zey9o+w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=disney.com; dmarc=pass action=none header.from=disney.com; dkim=pass header.d=disney.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=twdc.onmicrosoft.com; s=selector2-twdc-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WGfhSs2zP4gzxC9fLUVTW3ksh0wjN3YbvAteuuHV8Zk=; b=qff3K9UgJi4qQw9E0N1p5pExuWNiZQzntAdoBJV7tnQtj29VPdemDYlEHc41xvughK4VUlej3CnUbzlJsVqA+QteWN5vzHV0s4O2QXu2gJcXUSQjU0jQqr0l22MRSVUEFO3+6DR4Lsa0rPttHYru6nQRhbbiF9lMIBHfrUYUSTM= Received: from SJ0PR03MB6501.namprd03.prod.outlook.com (2603:10b6:a03:386::18) by MW5PR03MB6879.namprd03.prod.outlook.com (2603:10b6:303:1c9::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.19; Sun, 28 Aug 2022 00:38:18 +0000 Received: from SJ0PR03MB6501.namprd03.prod.outlook.com ([fe80::39c2:2acb:4607:daaf]) by SJ0PR03MB6501.namprd03.prod.outlook.com ([fe80::39c2:2acb:4607:daaf%8]) with mapi id 15.20.5566.015; Sun, 28 Aug 2022 00:38:18 +0000 From: "Barton, Mark" Thread-Topic: bug#50514: 28.0.50; org inline call to python src block req C-g to break Thread-Index: AQHYuJUcra94FftNmEeOPokxU5Hjm63BLvaAgAGOeMiAAA8mgIAAT80AgAArNoCAADQsgA== Date: Sun, 28 Aug 2022 00:38:18 +0000 Message-ID: <56BAC174-35F5-4ED6-8923-729B2DE20490@disney.com> References: <9CADADD8-72C0-4951-9950-AC7149B339F4@gmail.com> In-Reply-To: <9CADADD8-72C0-4951-9950-AC7149B339F4@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: Apple Mail (2.3696.120.41.1.1) x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 9e8bf424-5031-4d4f-1cc9-08da888d99f7 x-ms-traffictypediagnostic: MW5PR03MB6879:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Uxl2m7EZGwlcqjI7upgLfYE79q/h/S2wC/3Y1ZG8edBbthdlKXQzIGTlAOPqf6MW9JDmDp20Fcmll55iMFxNo0vP5h1ke1WfMkA8HlfZzFxMmKz2JRsWjydWFp5P1QklIYt8spjN54VS71RrXG/k2moN9ZSL58j8qujb4c7w1/piy28bpxNhyq+Le0nv6NXbRIyP+VEV1EbqSMxXKx/GxuN+1Fad7nyuaRSnEGqsmpR/CVvJolzUd3Azd1wxEn/dvBbjfUssDKDzIF2X70h4xkmzjZ0hha9MUyPIfPofUbuc7b6HELqBBMzsrYEhWINaEetbbPMNO104H6MZFenWanERpH8AVS4pATrL/vC0ZFrXkpQhRkmrgF1QkJf4zVRAo+nMJ17wZ5RnEdBI8G8lDxXtObZsLDG70Ka4M7G881WZNuAfzcJmkzhMjr09zv120gy+WZWXzmJF0vb4fvuUg74Kp/I6cxYPQ0Xa0ID0fn4wUo5dZjYXy0KEfHOUmSmHrbdO42CLZKg28tXoZ1KYVpilyNy4Os138m+ZGIbxvlr0BL9eV3MIAOuZZ2DAVuLByLM3fvoWdZcRFNEupC11SZV2eNTwHItv8jM+cLfw3GSnmA8wuUSDDf1rbkDR9bqhUDlAe0Pd+y2xBG+gk2eIPmkfGSSroKvTLmGCIKJ6opiw/uQ75n/Aa2Znp0oS6Bsze+Q1Lqa9++d0IZZItzwVr9JDEiif0viQBPn2v/OZFC3Q9R2NrSdJIeMMNUwyieH2QNq6gR0g7dRLjFelB+zcAUOadiVQIgWM3v6fzg1EnrU= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR03MB6501.namprd03.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(4636009)(39860400002)(346002)(136003)(396003)(366004)(376002)(38070700005)(186003)(82960400001)(86362001)(54906003)(6916009)(38100700002)(122000001)(71200400001)(316002)(36756003)(2616005)(5660300002)(478600001)(66556008)(66946007)(66446008)(76116006)(64756008)(8936002)(6512007)(66476007)(4326008)(8676002)(6486002)(41300700001)(33656002)(6506007)(83380400001)(2906002)(45980500001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: DdA5QbzPuqwY252Z2/aXgXHH9bKMVQduh1AWvSU9LeOpdTUllB5Nef/NkG7Lzuxhua4ULCbN2m1gE8Jsx6HKvAfWhNWm/MMdSXsgaCxNKzOoWGDm/LxynZdg3mfSkLl2PLbByzgWZafG1mBhmA2B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vEtXUS8NfcPSpuXpS5NcnYuUCY4aWtyMp6zQTpFVBvQAShaHhn6Ir+crUMD73jdAjsWRdhjfxnby6mYiIdbhtitCTp9x51DYvz779iQV6Zut1LLq6jGhLH6gyROM8G8YAnZAOVj66/9xsqq25eFuCde/1V+Sxq/tEy/XI+9KbxZbFZEWIovv9hLbmRv2S6KhylPP62DhTdOzZR+NUmnNkCFZ/RzSS3nc3XCPCSWOCK6nGjX+klTTRFTy2cbiBPNzvJyZpTAOq/OpDYYw6nefU1b3PT9eL93+TNGJXAJ7MI25EwNrs6tFoX60FdHdKKOuZyKfgk4qkt9Mxw1YwKIC16RpDLshUB7ovz261w14EB1k46Xg2WGiwCMcKoIbFPCK81M4bYcPVK6GquD03lp74CewCtkCKCI4tFm9p6c15OdzGMAzwIE2wRO+T1YlWat8GASaZefOfGJAUQ== Content-Type: multipart/alternative; boundary="_000_56BAC17435F54ED68923729B2DE20490disneycom_" MIME-Version: 1.0 X-OriginatorOrg: disney.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6501.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9e8bf424-5031-4d4f-1cc9-08da888d99f7 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Aug 2022 00:38:18.0596 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 56b731a8-a2ac-4c32-bf6b-616810e913c6 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: tnTu7eBRtXPSP4All5q/SiOf7vfXpjMNMDXcVJIJhmMS7IayOTpr0fNBCudFP+4ZUMhS8LSk8gTe97z+BY8ykw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW5PR03MB6879 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=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1661647184; 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: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=WGfhSs2zP4gzxC9fLUVTW3ksh0wjN3YbvAteuuHV8Zk=; b=WglWxEiYxpVpC3UtvTqNiv2TbLTEibaVHG0m/U7D+6Z+JNkmGQMvdKYQdcfa6rsXuPfu9O Jg9UKBzdQQsZ0MQR5CVfO0KvrziEpMYiIpMylbbAv1siqf8mm4W7EJ8fgPM81HPXJ1iC9B GJzwvjgr/tPh/u0L/G/3pgx8o58zMI5NW8qsscyEE+TSNh2T29K/LlxlVT2KRzjkHlZnjL AS+3Me9cNge+j6w/UAODIwKtLZCNvUQdwcvRQf0zSR37LfdL0LWa9ESKD3I1bXdOiExdr9 AnyDSVJ9+ib0x0OLG7tcvDKq3yKmuqg+7OkATnyvEoaOp1tnl6XnfEsjP8iC6g== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1661647184; a=rsa-sha256; cv=fail; b=TtBz1sXZ7zwkHW2ORHBeZSbLW6+XKf0UEhFG/F6qlB2y+4ooc3hoNXM9w9v3s0jxSw0IQY OOvJydq3SSDbBmsxDNBKA/2F8rvUPy1nEb25AKA+2XkOU8LRnGUEllOLxeiIEal6dOsTfB SGc3jeFEruZYCsg0kgmQBNykz0lZp2W+eqGA0if42gVKa7RinfTFUsE3pIs20oMKRW+xPH Q8um16WWvj02vb9HL5h6NSfg70At9bHOJ8QXaCfGfEt/4FaIV1c3VhvBPFhOi/acP5GWzT qACsSsMQ1gYP0UwwukUNUKnLlG7TCmilFAougwZqx5uHyLnw3l8d8rQSJjHDTg== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=twdc.onmicrosoft.com header.s=selector2-twdc-onmicrosoft-com header.b=qff3K9Ug; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); dmarc=fail reason="SPF not aligned (relaxed)" header.from=disney.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: 8.20 X-Spam: Yes Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=twdc.onmicrosoft.com header.s=selector2-twdc-onmicrosoft-com header.b=qff3K9Ug; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); dmarc=fail reason="SPF not aligned (relaxed)" header.from=disney.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: F3679C2A5 X-Spam-Score: 8.20 X-Migadu-Spam: Yes X-Migadu-Scanner: scn0.migadu.com X-TUID: NdBniedhU8J0 --_000_56BAC17435F54ED68923729B2DE20490disneycom_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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 t= ried 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 b= locks 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 workar= ound. One thing that might work is to block until the shell is ready with somethi= ng 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) --_000_56BAC17435F54ED68923729B2DE20490disneycom_ Content-Type: text/html; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable

I will work on getting more details this weeke= nd. It looked like the buffer passed to org-babel-comint-wait-for-output wa= s missing the "earmuffs". I tried adding the earmuffs with the or= g 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 read= y with something like

    (run-python)
    (with-current-buffer *the-shell-buffer*
      (while (not python-shell--first-prompt-r= eceived)
        (accept-process-output (get-buffe= r-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-ou= tput (get-buffer-process (current-buffer)))))
+          ))
        ((and (eq 'python-mode org-babel-python-= mode)
      (fboundp 'py-shell)) ; python-mode.el
  (require 'python-mode)

--_000_56BAC17435F54ED68923729B2DE20490disneycom_--