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 06:57:31 -0800 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000453d8b05ef15ea4a" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14247"; 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:41:47 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 1p2Mxv-0003WC-4D for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 06 Dec 2022 02:41:47 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p2MxG-0006JM-JM; Mon, 05 Dec 2022 20:41:06 -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 1p2MxE-0006Ig-NO for bug-gnu-emacs@gnu.org; Mon, 05 Dec 2022 20:41:04 -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 1p2MxD-0002jA-9C for bug-gnu-emacs@gnu.org; Mon, 05 Dec 2022 20:41:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p2MxB-00042P-L0 for bug-gnu-emacs@gnu.org; Mon, 05 Dec 2022 20:41:01 -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:41:01 +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.167029084315499 (code B ref 58780); Tue, 06 Dec 2022 01:41:01 +0000 Original-Received: (at 58780) by debbugs.gnu.org; 6 Dec 2022 01:40:43 +0000 Original-Received: from localhost ([127.0.0.1]:39571 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2Mws-00041v-VF for submit@debbugs.gnu.org; Mon, 05 Dec 2022 20:40:43 -0500 Original-Received: from relay5-d.mail.gandi.net ([217.70.183.197]:37239) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2CvB-00045q-OY for 58780@debbugs.gnu.org; Mon, 05 Dec 2022 09:58:18 -0500 Original-Received: (Authenticated sender: public@ryanb.org) by mail.gandi.net (Postfix) with ESMTPSA id B7EFC1C0007 for <58780@debbugs.gnu.org>; Mon, 5 Dec 2022 14:58:08 +0000 (UTC) Original-Received: by mail-vs1-f53.google.com with SMTP id b189so5408683vsc.10 for <58780@debbugs.gnu.org>; Mon, 05 Dec 2022 06:58:08 -0800 (PST) X-Gm-Message-State: ANoB5pl8uy51EAj0+0kPJrrFxM6VhR94Yp7kk7iOHWgWoief/waixFgw /bEruwtz8VxwdhrfgGxPH1ORKHiFGs3wUaULn54= X-Google-Smtp-Source: AA0mqf7u1zjcVDE/Ezmsdj6HZcfiOEGuXq+7+pG6LBajMbIushsKqnoGcLO+strQcsRmL1gwZf0PvQCD7lrDI8dXp1Y= X-Received: by 2002:a67:f8d4:0:b0:3aa:1a3a:6447 with SMTP id c20-20020a67f8d4000000b003aa1a3a6447mr36039103vsp.50.1670252287308; Mon, 05 Dec 2022 06:58:07 -0800 (PST) In-Reply-To: X-Gmail-Original-Message-ID: X-Mailman-Approved-At: Mon, 05 Dec 2022 20:40:42 -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:250080 Archived-At: --000000000000453d8b05ef15ea4a Content-Type: text/plain; charset="UTF-8" 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 Emacs > 28.2. I now hit it very often, it's pretty painful. I don't know for sure > that it's the same bug, but it seems likely. Reproduces with emacs -Q: > > ====== > 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 > ====== > > 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/ --000000000000453d8b05ef15ea4a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Confirmed, probably the same root cause. When I brute= force override python-nav-end-of-statement like below, it doesn't happ= en any more.

(defun python-nav-end-of-statemen= t (&optional noend)
=C2=A0 (interactive "^")
=C2=A0 (fo= rward-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 with a single quote ' , as opposed to = triple string. I think I started seeing this hang after upgrading to Emacs = 28.2. I now hit it very often, it's pretty painful. I don't know fo= r sure that it's the same bug, but it seems likely. Reproduces with ema= cs -Q:

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

=C2=A0 def __init__(self):
=C2=A0 =C2=A0 '

=C2= =A0 def bar(self):
=C2=A0 =C2=A0 """Fetches posts and con= verts them to ActivityStreams activities.
=C2=A0 =C2=A0 See source.Sourc= e.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 "&quo= t;"
=C2=A0 =C2=A0 pass
=3D=3D=3D=3D=3D=3D
<= br>
The single quote and multiple lines in the docstring are nece= ssary 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,=20 aarch64-apple-darwin21.1.0, NS appkit-2113.00 Version 12.0.1 (Build=20 21A559)) of 2022-09-12



--
--000000000000453d8b05ef15ea4a--