From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gabriel Brown Newsgroups: gmane.emacs.bugs Subject: bug#62325: Python quotes/apostrophes can cause hang Date: Mon, 20 Mar 2023 18:36:16 -0500 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-q1G2MuwWMsJaVhPnG/l3" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11337"; mail-complaints-to="usenet@ciao.gmane.io" To: 62325@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Mar 21 09:30:31 2023 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 1peXO3-0002rM-RJ for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 21 Mar 2023 09:30:31 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1peXNc-0006Sf-Cl; Tue, 21 Mar 2023 04:30:04 -0400 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 1peXNb-0006SP-ES for bug-gnu-emacs@gnu.org; Tue, 21 Mar 2023 04:30:03 -0400 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 1peXNa-0002yW-KR for bug-gnu-emacs@gnu.org; Tue, 21 Mar 2023 04:30:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1peXNa-0000jI-Fy for bug-gnu-emacs@gnu.org; Tue, 21 Mar 2023 04:30:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gabriel Brown Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 21 Mar 2023 08:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 62325 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16793873582692 (code B ref -1); Tue, 21 Mar 2023 08:30:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 21 Mar 2023 08:29:18 +0000 Original-Received: from localhost ([127.0.0.1]:57554 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1peXMr-0000hL-MI for submit@debbugs.gnu.org; Tue, 21 Mar 2023 04:29:18 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:33724) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1peP3C-0003Zj-2z for submit@debbugs.gnu.org; Mon, 20 Mar 2023 19:36:26 -0400 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 1peP3B-00056E-Po for bug-gnu-emacs@gnu.org; Mon, 20 Mar 2023 19:36:25 -0400 Original-Received: from mail-ot1-x329.google.com ([2607:f8b0:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1peP3A-0007un-4n for bug-gnu-emacs@gnu.org; Mon, 20 Mar 2023 19:36:25 -0400 Original-Received: by mail-ot1-x329.google.com with SMTP id k14-20020a056830150e00b0069f156d4ce9so3055318otp.6 for ; Mon, 20 Mar 2023 16:36:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679355382; h=mime-version:message-id:to:subject:from:date:from:to:cc:subject :date:message-id:reply-to; bh=WxNebXqbrwEQUfKh1DHwFgAy9F6afnVOoWFo4hUd3LM=; b=aGTNuSOqGw4bEEDb/j0Y3Iux1BpEAV6ntrsh0Fe+V7Wn6AVmzlzK6BkL0WLwlnZfuN 1arCxuZFSWH1pOBDVmv4d1/FZPjK1jMIzqe/ZEm+wJeLqnMlLeC4t21i7X/jF0OXJQc0 n+v4MKVQlUWoHAah4h9HuKnnQ0e+hci+eDZuBT420dKj1ISuu9SZ6ES79i22OGf3ZlCP aUeWvefmrvm602hfRpbbcKcRJnwM/RzZa4FIPyWznqawDOK83dtj1ql4NW1yH3+fmFO9 2Dw4o/Q61NzjhSSp5HL9XOgUUPxKtEMcr4czk6WMAGriLgdJzWUnaTgeOGLspfED1XVD qF6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679355382; h=mime-version:message-id:to:subject:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=WxNebXqbrwEQUfKh1DHwFgAy9F6afnVOoWFo4hUd3LM=; b=qWzcG1tkIRIpJBWEamctk1GQtO88JbMqJYkAcW37S6esq5EUyrTuK68tr41dDWhDMK kkdwW5RyEcfl/PTqkAtiu9YsDgbBJS/s6aBcsanWK70ckJS1+7jgOVNAamFlaT8tLaxy wVJXZbWAKDhXHB9JYu8kdV+ENwm4oYKdLRzodeadnAj99pXJVBsq0ssYDh0ud8Lw3URO 29fOKSUh6/GxI0kr4f6mk7sia8QM7L/C9FlRhJfczsix/0U3i7ESjOzfxSur63+NFzXt hUY08k0TWGwl9VJQ1bkTFZ1O6Xlns20lwIZ41aja+c2AGvOMlIue7FBmcnWxtMPB5PKE TzAg== X-Gm-Message-State: AO0yUKViSMBWDHhTXno9hKFE78KsjFA5+E+SLCAVZb8lp32pMynk2wmS cCzKtCARfbNamz8wvSkPrEbW1SbhsA== X-Google-Smtp-Source: AK7set+IcMazef85z8Wc9BWmqHxi5rhj4Uh/7uMjWT8Yt/R/09FM3FiIfPqzncbhUUdcQ60qFGlkJQ== X-Received: by 2002:a9d:7382:0:b0:69f:4bb:199f with SMTP id j2-20020a9d7382000000b0069f04bb199fmr220976otk.23.1679355382209; Mon, 20 Mar 2023 16:36:22 -0700 (PDT) Original-Received: from [10.146.168.166] (nat-128-62-42-139.public.utexas.edu. [128.62.42.139]) by smtp.gmail.com with ESMTPSA id e81-20020a4a5554000000b0053b543b027bsm295186oob.42.2023.03.20.16.36.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Mar 2023 16:36:21 -0700 (PDT) X-Mailer: geary/43.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::329; envelope-from=gabriel.h.brown@gmail.com; helo=mail-ot1-x329.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-Mailman-Approved-At: Tue, 21 Mar 2023 04:29:17 -0400 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:258334 Archived-At: --=-q1G2MuwWMsJaVhPnG/l3 Content-Type: multipart/alternative; boundary="=-Kj3AjObaauAcpmiBUSHf" --=-Kj3AjObaauAcpmiBUSHf Content-Type: text/plain; charset=us-ascii; format=flowed Hi, all. First bug report for me. I've searched to see if there are other reports of my issue, but turned up empty handed. --- Summary --- It seems when there are three or more python docstrings (each bordered by two lines of triple quotes """) and each containing an apostrophe, then the next time a quote docstring is to be inserted Emacs hangs. I have included a minimum viable example file that reproduces this behavior on my machine. Simply replace the angle bracket line containing the instructions with triple quotes, and Emacs should hang. (In case file attachments don't work I have included the text of the file at the end of the email.) --- Additional information --- Emacs version: 28.2 (via pacman package manager) machine: EndeavourOS Linux x86_64 (kernel: 6.2.2-arch1-1) reply email: gabriel.h.brown@gmail.com --- start of example file --- def f_0(): # inline comment < try replacing with triple quotes > return 4 def f_1(): """ ghbrown's first comment """ return 1 def f_2(): """ ghbrown's second comment """ return 1 def f_3(): """ ghbrown's third comment """ return 1 --- end of example file --- --=-Kj3AjObaauAcpmiBUSHf Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: quoted-printable
Hi, all. First bug report for me. = I've searched to see if there are other reports of my issue, but turned up = empty handed.

--- Summary ---
It seems w= hen there are three or more python docstrings (each bordered by two lines o= f triple quotes """) and each containing an apostrophe, then the next time = a quote docstring is to be inserted Emacs hangs.

I= have included a minimum viable example file that reproduces this behavior = on my machine. Simply replace the angle bracket line containing the instruc= tions with triple quotes, and Emacs should hang. (In case file attachments = don't work I have included the text of the file at the end of the email.)

--- Additional information ---
Emacs vers= ion: 28.2 (via pacman package manager)
machine: EndeavourOS Linux= x86_64 (kernel: 6.2.2-arch1-1)
reply email: gabriel.h.brown@gmai= l.com

--- start of example file ---
def f_0():
    # inline comment
   = ; < try replacing with triple quotes >
    return= 4

def f_1():
    """
    ghbrown's first comment
    """
    return 1

def f_2():
&nb= sp;   """
    ghbrown's second comment
&= nbsp;   """
    return 1

= def f_3():
    """
    ghbrown's th= ird comment
    """
    return 1
--- end of example file ---

--=-Kj3AjObaauAcpmiBUSHf-- --=-q1G2MuwWMsJaVhPnG/l3 Content-Type: text/x-python Content-Disposition: attachment; filename=mve.py Content-Transfer-Encoding: base64 CmRlZiBmXzAoKToKICAgICMgaW5saW5lIGNvbW1lbnQKICAgIDwgdHJ5IHJlcGxhY2luZyB3aXRo IHRyaXBsZSBxdW90ZXMgPgogICAgcmV0dXJuIDQKCmRlZiBmXzEoKToKICAgICIiIgogICAgZ2hi cm93bidzIGZpcnN0IGNvbW1lbnQKICAgICIiIgogICAgcmV0dXJuIDEKCmRlZiBmXzIoKToKICAg ICIiIgogICAgZ2hicm93bidzIHNlY29uZCBjb21tZW50CiAgICAiIiIKICAgIHJldHVybiAxCgpk ZWYgZl8zKCk6CiAgICAiIiIKICAgIGdoYnJvd24ncyB0aGlyZCBjb21tZW50CiAgICAiIiIKICAg IHJldHVybiAxCg== --=-q1G2MuwWMsJaVhPnG/l3--