From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ryan B Newsgroups: gmane.emacs.bugs Subject: bug#58780: python.el infinite loop in info-current-defun Date: Mon, 5 Dec 2022 12:32:23 -0800 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000d898ae05ef1a9730" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18190"; mail-complaints-to="usenet@ciao.gmane.io" To: 58780@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 06 02:42:37 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p2Myi-0004YY-Vg for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 06 Dec 2022 02:42:37 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p2MyH-0006kr-TP; Mon, 05 Dec 2022 20:42:09 -0500 Original-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 1p2MyD-0006k2-V4 for bug-gnu-emacs@gnu.org; Mon, 05 Dec 2022 20:42:05 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p2MyB-0002wR-I2 for bug-gnu-emacs@gnu.org; Mon, 05 Dec 2022 20:42:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p2MyA-00043p-VA for bug-gnu-emacs@gnu.org; Mon, 05 Dec 2022 20:42:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ryan B Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 06 Dec 2022 01:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58780 X-GNU-PR-Package: emacs Original-Received: via spool by 58780-submit@debbugs.gnu.org id=B58780.167029086615586 (code B ref 58780); Tue, 06 Dec 2022 01:42:02 +0000 Original-Received: (at 58780) by debbugs.gnu.org; 6 Dec 2022 01:41:06 +0000 Original-Received: from localhost ([127.0.0.1]:39581 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2MxF-00043J-Q7 for submit@debbugs.gnu.org; Mon, 05 Dec 2022 20:41:06 -0500 Original-Received: from relay2-d.mail.gandi.net ([217.70.183.194]:41543) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2I9D-0001Hq-Hb for 58780@debbugs.gnu.org; Mon, 05 Dec 2022 15:33:08 -0500 Original-Received: (Authenticated sender: public@ryanb.org) by mail.gandi.net (Postfix) with ESMTPSA id B13E240008 for <58780@debbugs.gnu.org>; Mon, 5 Dec 2022 20:33:00 +0000 (UTC) Original-Received: by mail-ua1-f49.google.com with SMTP id e24so4303772uam.10 for <58780@debbugs.gnu.org>; Mon, 05 Dec 2022 12:33:00 -0800 (PST) X-Gm-Message-State: ANoB5plV70s+9lqgEjibFhuIV1c+zphRW+XPBXZh2irT+GX4aJQtg3Lz Q86469m0C49wkTh50Hu7k8zjttIABiZnofY9UUo= X-Google-Smtp-Source: AA0mqf5Gd7AdJM74VnJQ5C8QcaE5ksHgoYrRO5S0Vl+vhhuanCw0J1cA+R1XfSMo1qr1ZIQ2hpkDgyp3EeXX9vKgGsM= X-Received: by 2002:ab0:238f:0:b0:411:968:212 with SMTP id b15-20020ab0238f000000b0041109680212mr51144038uan.107.1670272379293; Mon, 05 Dec 2022 12:32:59 -0800 (PST) In-Reply-To: X-Gmail-Original-Message-ID: X-Mailman-Approved-At: Mon, 05 Dec 2022 20:41:03 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:250082 Archived-At: --000000000000d898ae05ef1a9730 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Advice seems to work better at preventing the hang: (defun python-nav-end-of-statement--bug-override (orig-fn &optional noend) (forward-line 1)) (advice-add 'python-nav-end-of-statement :around #'python-nav-end-of-statement--bug-override) On Mon, Dec 5, 2022 at 7:01 AM Ryan B wrote: > I take it back, that override doesn't fully prevent it after all. =F0=9F= =98=A2 > > On Mon, Dec 5, 2022 at 6:57 AM Ryan B wrote: > >> Confirmed, probably the same root cause. When I brute force override >> python-nav-end-of-statement like below, it doesn't happen any more. >> >> (defun python-nav-end-of-statement (&optional noend) >> (interactive "^") >> (forward-line 1)) >> >> >> On Mon, Dec 5, 2022 at 6:44 AM Ryan B wrote: >> >>> I think I have a repro for this with a single quote ' , as opposed to >>> triple string. I think I started seeing this hang after upgrading to Em= acs >>> 28.2. I now hit it very often, it's pretty painful. I don't know for su= re >>> that it's the same bug, but it seems likely. Reproduces with emacs -Q: >>> >>> =3D=3D=3D=3D=3D=3D >>> class Foo(): >>> >>> def __init__(self): >>> ' >>> >>> def bar(self): >>> """Fetches posts and converts them to ActivityStreams activities. >>> See source.Source.get_activities_response for details. app_id is >>> ignored. min_id is translated to Twitter's since_id. >>> """ >>> pass >>> =3D=3D=3D=3D=3D=3D >>> >>> The single quote and multiple lines in the docstring are necessary for >>> the repro. No extra newline at the end needed though. >>> >>> JD, do you have a workaround for this? I may look into overriding >>> python-nav-end-of-defun until it's fixed. Any other ideas? >>> >>> My emacs-version: GNU Emacs 28.2 (build 1, aarch64-apple-darwin21.1.0, >>> NS appkit-2113.00 Version 12.0.1 (Build 21A559)) of 2022-09-12 >>> >>> -- >>> https://snarfed.org/ >>> >> >> >> -- >> https://snarfed.org/ >> > > > -- > https://snarfed.org/ > --=20 https://snarfed.org/ --000000000000d898ae05ef1a9730 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Advice seems to work better at preventing the hang:

(defun python-nav-end-of-statement--bug-override (o= rig-fn &optional noend)
=C2=A0 (forward-line 1))
(advice-add '= ;python-nav-end-of-statement :around #'python-nav-end-of-statement--bug= -override)

On Mon, Dec 5, 2022 at 7:01 AM Ryan B <pair@ryanb.org> wrote:
I take it back, that ov= erride doesn't fully prevent it after all. =F0=9F=98=A2

On Mon, Dec = 5, 2022 at 6:57 AM Ryan B <pair@ryanb.org> wrote:
Confirmed, probably the same roo= t cause. When I brute force override python-nav-end-of-statement like below= , it doesn't happen any more.

(defun pytho= n-nav-end-of-statement (&optional noend)
=C2=A0 (interactive "^= ")
=C2=A0 (forward-line 1))


On Mon, Dec 5, = 2022 at 6:44 AM Ryan B <pair@ryanb.org> wrote:
I think I have a repro for this wit= h a single quote ' , as opposed to triple string. I think I started see= ing this hang after upgrading to Emacs 28.2. I now hit it very often, it= 9;s pretty painful. I don't know for sure that it's the same bug, b= ut it seems likely. Reproduces with emacs -Q:

= =3D=3D=3D=3D=3D=3D
class Foo():

=C2=A0 def __init__(se= lf):
=C2=A0 =C2=A0 '

=C2=A0 def bar(self):
=C2=A0 =C2=A0 &= quot;""Fetches posts and converts them to ActivityStreams activit= ies.
=C2=A0 =C2=A0 See source.Source.get_activities_response for details= . app_id is
=C2=A0 =C2=A0 ignored. min_id is translated to Twitter's= since_id.
=C2=A0 =C2=A0 """
=C2=A0 =C2=A0 pass
=3D=3D=3D=3D=3D=3D

The single quote and mu= ltiple lines in the docstring are necessary for the repro. No extra newline= at the end needed though.

JD, do you have a workaround for t= his? I may look into overriding python-nav-end-of-defun until it's fixe= d. Any other ideas?

My emacs-version: GNU= Emacs 28.2 (build 1,=20 aarch64-apple-darwin21.1.0, NS appkit-2113.00 Version 12.0.1 (Build=20 21A559)) of 2022-09-12



--


--


--
--000000000000d898ae05ef1a9730--