#1058574 emacs-el: emacs reliably hangs when editing python source with certain docstrings

Package:
emacs-el
Source:
emacs-el
Submitter:
Mike Castle
Date:
2024-01-18 14:57:23 UTC
Severity:
normal
Tags:
#1058574#5
Date:
2023-12-13 04:57:30 UTC
From:
To:
Dear Maintainer,

When editing the following file, emacs will reliably hang:
$ cat bug.py
def foo(self):
    """Foo."""
    """
    pass

def baz(self):
    """Ba'r."""
    pass


The problem seems triggered by the single-quote in the second docstring.  Upon
research, this is likely a problem specific to the version of
progmodes/python.el shipped with emacs 28.2.  Although the above specific test
case did not seem to match other reports I saw.

I'm not comfortable enough mixing and matching something like emacs-el from
backports (which is 29.1) with stable emacs 28.2 (not enough experience with
emacs).

Some reference threads:
https://lists.gnu.org/archive/html/bug-gnu-emacs/2023-01/msg01686.html
https://www.reddit.com/r/emacs/comments/z0oye9/emacs_freezes_when_opening_a_python_file
https://emacs.stackexchange.com/questions/74167/python-mode-hangs-on-class-member-comment

#1058574#10
Date:
2023-12-13 05:06:38 UTC
From:
To:
Of course, as soon as I file the bug, THEN I find a likely duplicate:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1032522