Subject: bug#68284: closed (Re: bug#68284: [PATCH] Fix python-info-docstring-p bug in the 2nd line of a buffer)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 13 Jan 2024 09:36:02 +0000

Your bug report

#68284: [PATCH] Fix python-info-docstring-p bug in the 2nd line of a buffer

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
68284: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=68284
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#68284: [PATCH] Fix python-info-docstring-p bug in the 2nd line of a buffer
From: Eli Zaretskii <[email-masked]>
To: kobarity <[email-masked]>
Cc: [email-masked]
Date: Sat, 13 Jan 2024 11:34:38 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

> Date: Sat, 06 Jan 2024 22:12:36 +0900
> From: kobarity <[email-masked]>
> 
> No matter what the first line of the buffer is, if the second line is
> a string literal, `python-info-docstring-p` will misjudge it as a
> docstring.  This issue can be reproduced as follows:
> 
> 1. emacs -Q
> 2. Open a Python file whose contents are as follows:
> 
> #+begin_src python
> import sys
> """Not a docstring."""
> #+end_src
> 
> 3. Locate the point at the string literal on the second line.
> 4. M-: (python-info-docstring-p)
> 
> Although this string literal is not a docstring, it returns t.
> Therefore, in `python-mode` (not `python-ts-mode`), this string
> literal is rendered in `font-lock-doc-face`.
> 
> This is the reason I changed some ERTs to "expected fail" in the
> commit b7b82ecb2b4c2ce33c11e5388b692cd403ab55e6 of Bug#63622.
> 
> Attached is a patch to fix this bug and the above mentioned ERTs and
> to restore ERTs I deleted by mistake in commit
> 6b2c8dc9050c5c0514fa404733ce1d4a37d00e39 of Bug#63844 (related to
> Bug#63622).

Thanks, installed on the master branch, and closing the bug.

Subject: [PATCH] Fix python-info-docstring-p bug in the 2nd line of a buffer
From: kobarity <[email-masked]>
To: [email-masked]
Date: Sat, 06 Jan 2024 22:12:36 +0900
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

No matter what the first line of the buffer is, if the second line is
a string literal, `python-info-docstring-p` will misjudge it as a
docstring.  This issue can be reproduced as follows:

1. emacs -Q
2. Open a Python file whose contents are as follows:

#+begin_src python
import sys
"""Not a docstring."""
#+end_src

3. Locate the point at the string literal on the second line.
4. M-: (python-info-docstring-p)

Although this string literal is not a docstring, it returns t.
Therefore, in `python-mode` (not `python-ts-mode`), this string
literal is rendered in `font-lock-doc-face`.

This is the reason I changed some ERTs to "expected fail" in the
commit b7b82ecb2b4c2ce33c11e5388b692cd403ab55e6 of Bug#63622.

Attached is a patch to fix this bug and the above mentioned ERTs and
to restore ERTs I deleted by mistake in commit
6b2c8dc9050c5c0514fa404733ce1d4a37d00e39 of Bug#63844 (related to
Bug#63622).

--
In GNU Emacs 30.0.50 (build 3, x86_64-pc-linux-gnu, X toolkit, cairo
 version 1.16.0, Xaw scroll bars) of 2024-01-03 built on ubuntu
Repository revision: 91bc775b0c60342f118640001d2ce293d4f1f7ef
Repository branch: master
System Description: Ubuntu 22.04.3 LTS