From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id QJwbOsLx62QDcgAAG6o9tA:P1 (envelope-from ) for ; Mon, 28 Aug 2023 03:00:51 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id QJwbOsLx62QDcgAAG6o9tA (envelope-from ) for ; Mon, 28 Aug 2023 03:00:51 +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 787A35D859 for ; Mon, 28 Aug 2023 03:00:50 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=pdb3NP6f; 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"; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1693184450; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=5kPa3Bw/UqD2nW5R5aEK6p1qLD0USxaYCQ7D1SrdyN4=; b=dP5ykKVRF2rOiqJIzIGt5kFNRAF2XX5tkCnBmnWVFjMxBepQghvxsp9c4qRbl6oS50roQL J+b/TlE9pm2x2UcY4Q6cjb6lgjL+hldjVbVQVPsj63whjuzkjV1ib07XD9nOJMOSEpfGD3 JameHkXVSzWBLytxlrmwscTCn1aW+mwGnXIIeJVKE45AP1Oy/G5bNIhxTHGUSn6SSjKRH0 H8tCKx2AyYOcMfME1KdI+yBArwudru12ivdz0Y+G2jgJCT857KVePv6tYHGRLLapDGJBBc dQWACFIMhZxzeI6chi4bFEE/pzJQMJ51sj805YyK0OKaOM+vDTf/JcskyXJHnA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1693184450; a=rsa-sha256; cv=none; b=Wu0eRbA/fWpc41ZDj0C4+A9ib19e9Y7xn2GXx6fTKgKPVJ39iOIu+CD6PCKhBXdp9ZFxOj xJ9QLj/R7InlRYBN52Nc8sBwkN6v6rqnr+fOmI2QvtoqppvzQ5QxicLCoZEejgzU3xgroT +DPKtt0C11Kx8Bws74NeuO0bhFS6XulAnF5muoZTkDHmw+XHIoQ0SyPln0PBHH3zCzp3aN AC3LpkkLRR/9aIhDNEpaYbfflm0BsDNyalZRNbhqphrIsoxYu+RO3NWLUYIU65D9MFkyLE 2EU8rfJ0ZYTiG6x0lIHdXERqunHQVtTxSsROvMgpdXBotC044Fx5Aww/43clpw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=pdb3NP6f; 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"; dmarc=pass (policy=none) header.from=gmail.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qaQ8h-0002H7-Hk; Sun, 27 Aug 2023 20:29:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qaQ8Y-0002GB-PH for emacs-orgmode@gnu.org; Sun, 27 Aug 2023 20:29:48 -0400 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qaQ8W-0004rn-36 for emacs-orgmode@gnu.org; Sun, 27 Aug 2023 20:29:46 -0400 Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-5008faf4456so4114602e87.3 for ; Sun, 27 Aug 2023 17:29:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693182578; x=1693787378; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=5kPa3Bw/UqD2nW5R5aEK6p1qLD0USxaYCQ7D1SrdyN4=; b=pdb3NP6fIOr2HxdrewKOq3RD+qOFsUATin9pxTkh8IRUSLTA1hXVHbjh3VNTwPjIqu Ajcdt3IPpblqfKiAX265UNaGkCfoDT1IPaPkRo7KkPJsCZ4HGcQVwAtHVBxNb1TUExQl 5GQmmypPMe1mYRTvlwrNWUuACKIgo6jPdwPJOJqLIQq0kkb4Uwt3VNerBXuzYmS74dtI NLIw/VZIQ0XewHvQxcrU2Xt3CkD7Q9gi6XmrxNfR5ZiCj5vdoYhTGktqNnUmvYWYfX2L u/1TzxtCZvoNPditCjD1DasfQE2uptMwOFWszI3BESqPV6P5Aqh9+LzVoX+sj16YazP7 8xEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693182578; x=1693787378; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=5kPa3Bw/UqD2nW5R5aEK6p1qLD0USxaYCQ7D1SrdyN4=; b=VyZur4h5hDfo0Sw91mJkmCqx1OcPhfxbUVlhLX7YVUDFUI/364NEwmjylRfwn58+sT Z6FKxrgt94SrIfKw9EETVcQz9SJnUe9RJj7FCDkNZ467Q3AJwBx3qPkDGqR9zCv2N2Z6 LwOu+zpW4y85SRjCfSugnhdKCs12DGSs/kHE9RssyxuMJwKM5bNSKcHd5rXGwQmB1tn/ a+y5GfzKUlQTtuhFwXItNIYf+maUr38J1HAnBgx+h23EJScJ4mWXG569vfJVUjmauPq0 p5u5nXS7aEe5gQ5XwYTL+uU7O3m+D1VmID/iYqhXaA/TlzgT2axZeXuD6zXzxwKBAlq8 jqSw== X-Gm-Message-State: AOJu0YwV6FB2Z38KojLtDuhMFWZOSCJB0QuE/WS5afQLD1s8z82YXreS SPXPlho7I6xeolKm4/dzn0nHsd8RK2PuunawiWE= X-Google-Smtp-Source: AGHT+IGtMvj6QDxkVU/vS1RwvpLqZObyG0fsw9sjfrX5S2ElSyHWR1/36iOJu8BzmDjkiayuoCVqh3QR2cJAK3Zr23g= X-Received: by 2002:a05:6512:31c8:b0:4f8:714e:27a8 with SMTP id j8-20020a05651231c800b004f8714e27a8mr19640907lfe.0.1693182578177; Sun, 27 Aug 2023 17:29:38 -0700 (PDT) MIME-Version: 1.0 References: <87ttsnh5bx.fsf@localhost> <87a5uc9nxm.fsf@gmail.com> In-Reply-To: <87a5uc9nxm.fsf@gmail.com> From: Peter Mao Date: Sun, 27 Aug 2023 17:29:25 -0700 Message-ID: Subject: Re: [BUG] ob-python hangs on second start [9.5.4 (release_9.5.4-763-g06373a @ ~/emacs/org-mode/lisp/)] To: Jack Kamm Cc: Ihor Radchenko , org-mode-email Content-Type: multipart/alternative; boundary="0000000000001cbae70603f0cabf" Received-SPF: pass client-ip=2a00:1450:4864:20::12b; envelope-from=peter.mao@gmail.com; helo=mail-lf1-x12b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -9.43 X-Spam-Score: -9.43 X-Migadu-Queue-Id: 787A35D859 X-Migadu-Scanner: mx1.migadu.com X-TUID: 4MppsAKWBFFG --0000000000001cbae70603f0cabf Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Aug 27, 2023 at 2:26=E2=80=AFPM Jack Kamm wrot= e: > Ihor Radchenko writes: > > > Confirmed. > > > > It looks like `python-shell-first-prompt-hook' does not get triggered > > in the described scenario with exit() and we enter infinite loop in the > > code below. > > I think `python-shell-first-prompt-hook' is actually still triggered, > but rather it is `org-babel-comint-wait-for-output' that is hanging > while waiting for startup. However, we can just replace it with a > `sleep-for' instead, because we now wait for > `org-babel-python--initialized' anyways. > > See the attached patch. Please let me know if it fixes the problem for > you. > Yes, this fixes the problem for me. I made the change locally to release_9.6.6 on emacs 29.1. I have the expected behavior back. thank you! Peter --0000000000001cbae70603f0cabf Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Sun, Aug 27, 2023 at 2:26=E2=80=AFPM J= ack Kamm <jackkamm@gmail.com&g= t; wrote:
Ihor Radchenko <yantar92@posteo.net> writes:

> Confirmed.
>
> It looks like `python-shell-first-prompt-hook' does not get trigge= red
> in the described scenario with exit() and we enter infinite loop in th= e
> code below.

I think `python-shell-first-prompt-hook' is actually still triggered, but rather it is `org-babel-comint-wait-for-output' that is hanging
while waiting for startup. However, we can just replace it with a
`sleep-for' instead, because we now wait for
`org-babel-python--initialized' anyways.

See the attached patch. Please let me know if it fixes the problem for
you.
=C2=A0
Yes, this fixes the problem for me.=C2=A0 I= made the change locally to release_9.6.6 on emacs 29.1.=C2=A0 I have the e= xpected behavior back. thank you!

Peter
=
--0000000000001cbae70603f0cabf--