This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: 3.11: tracing revisits class line after class docstring
Type: Stage: patch review
Components: Interpreter Core Versions: Python 3.11
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Mark.Shannon Nosy List: Mark.Shannon, erlendaasland, nedbat
Priority: normal Keywords: 3.11regression, patch

Created on 2022-01-10 14:17 by nedbat, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 30518 merged Mark.Shannon, 2022-01-10 16:24
Messages (5)
msg410217 - (view) Author: Ned Batchelder (nedbat) * (Python triager) Date: 2022-01-10 14:17
See the starred line in the trace output for 3.11:

$ cat class_def.py
class theClass:
    ''' the docstring. '''
    def __init__(self):
        ''' Another docstring. '''
        self.a = 1

$ python3.10 -c "import sys; print(sys.version)"
3.10.1 (main, Dec 14 2021, 08:30:13) [Clang 12.0.0 (clang-1200.0.32.29)]

$ python3.10 -m trace --trace class_def.py
 --- modulename: class_def, funcname: <module>
class_def.py(1): class theClass:
 --- modulename: class_def, funcname: theClass
class_def.py(1): class theClass:
class_def.py(2):     ''' the docstring. '''
class_def.py(3):     def __init__(self):

$ python3.11 -c "import sys; print(sys.version)"
3.11.0a3+ (heads/main:0fc58c1e05, Jan  8 2022, 19:45:58) [Clang 12.0.0 (clang-1200.0.32.29)]

$ python3.11 -m trace --trace class_def.py
 --- modulename: class_def, funcname: <module>
class_def.py(1): class theClass:
 --- modulename: class_def, funcname: theClass
class_def.py(1): class theClass:
class_def.py(2):     ''' the docstring. '''
class_def.py(1): class theClass:                    <<<*********
class_def.py(3):     def __init__(self):
msg410296 - (view) Author: Mark Shannon (Mark.Shannon) * (Python committer) Date: 2022-01-11 11:29
New changeset bd04fac7eb929cd11ab6985deb61d9780447fbff by Mark Shannon in branch 'main':
bpo-46331: Do not set line number of instruction storing doc-string. (GH-30518)
https://github.com/python/cpython/commit/bd04fac7eb929cd11ab6985deb61d9780447fbff
msg410297 - (view) Author: Erlend E. Aasland (erlendaasland) * (Python triager) Date: 2022-01-11 11:58
I recon this can be closed now?
msg410301 - (view) Author: Mark Shannon (Mark.Shannon) * (Python committer) Date: 2022-01-11 14:06
Ned, does this fix work for you?
msg410392 - (view) Author: Ned Batchelder (nedbat) * (Python triager) Date: 2022-01-12 12:13
Yes, thanks, this fixes it.
History
Date User Action Args
2022-04-11 14:59:54adminsetgithub: 90489
2022-01-14 14:30:52Mark.Shannonsetkeywords: + patch
assignee: Mark.Shannon
stage: patch review
2022-01-12 16:32:28Mark.Shannonsetkeywords: - patch
assignee: Mark.Shannon -> (no value)
stage: resolved -> (no value)
2022-01-12 12:36:55erlendaaslandsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2022-01-12 12:13:35nedbatsetmessages: + msg410392
2022-01-11 14:06:39Mark.Shannonsetstatus: pending -> open

messages: + msg410301
2022-01-11 11:58:13erlendaaslandsetstatus: open -> pending
nosy: + erlendaasland
messages: + msg410297

2022-01-11 11:29:05Mark.Shannonsetmessages: + msg410296
2022-01-10 16:24:19Mark.Shannonsetassignee: Mark.Shannon
2022-01-10 16:24:02Mark.Shannonsetkeywords: + patch
stage: patch review
pull_requests: + pull_request28720
2022-01-10 14:17:57nedbatcreate