Repository navigation
Closed
Labels
3.10 (EOL)end of life3.11only security fixesstdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error
Description
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee = None
closed_at = <Date 2021-10-16.17:37:28.444>
created_at = <Date 2021-09-20.16:30:58.559>
labels = ['type-bug', 'library', '3.10', '3.11']
title = 'Update doctect SyntaxErrors for location range'
updated_at = <Date 2021-10-16.17:51:11.950>
user = 'https://github.com/akulakov'bugs.python.org fields:
activity = <Date 2021-10-16.17:51:11.950>
actor = 'miss-islington'
assignee = 'none'
closed = True
closed_date = <Date 2021-10-16.17:37:28.444>
closer = 'pablogsal'
components = ['Library (Lib)']
creation = <Date 2021-09-20.16:30:58.559>
creator = 'andrei.avk'
dependencies = []
files = []
hgrepos = []
issue_num = 45249
keywords = ['patch']
message_count = 18.0
messages = ['402257', '402258', '402260', '402263', '402268', '402269', '402271', '402284', '402589', '402652', '402662', '402670', '402739', '402742', '403157', '403588', '404103', '404106']
nosy_count = 6.0
nosy_names = ['terry.reedy', 'blueyed', 'pablogsal', 'miss-islington', 'kj', 'andrei.avk']
pr_nums = ['28567', '28575', '28587', '28854', '28855', '28994']
priority = 'low'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue45249'
versions = ['Python 3.10', 'Python 3.11']Linked PRs
- gh-89412: Add missing attributes (added in 3.10) to traceback module docs #105046
- [3.12] gh-89412: Add missing attributes (added in 3.10) to traceback module docs (GH-105046) #105327
- [3.11] gh-89412: Add missing attributes (added in 3.10) to traceback module docs (GH-105046) #105328
- [3.10] gh-89412: Add missing attributes (added in 3.10) to traceback module docs (GH-105046) #105329
Metadata
Metadata
Assignees
Labels
3.10 (EOL)end of life3.11only security fixesstdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error
Activity
akulakov commentedon Sep 20, 2021
It seems like fine grained error locations do not work in failed doctest traceback output:
version 3.11.0a0
file contents:
------------------
OUTPUT
-------
Failed example: 1 1 Exception raised: Traceback (most recent call last): File "/Users/ak/opensource/cpython/Lib/doctest.py", line 1348, in __run exec(compile(example.source, filename, "single", ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<doctest __main__.a[0]>", line 1 1 1 ^ SyntaxError: invalid syntax. Perhaps you forgot a comma?The location in doctests that causes this:
cpython/Lib/doctest.py
Line 1348 in 5846c9b
akulakov commentedon Sep 20, 2021
I've ran into this when looking at doctest docs, the issue is that they use the old example where a single column is highlighted, I want to update it to explain why doctest output differs from the one you get from REPL, but I probably need to understand why it happens to provide a good explanation.
Alternatively this may be fixed to be consistent if it's easy enough to do.
pablogsal commentedon Sep 20, 2021
Hummmm, could you explain a bit more in detail what is the expected output? I can see highlighting in the exec call that you pasted:
The fact that you see those "^^^^^^" indicate that is working no? What is missing?
akulakov commentedon Sep 20, 2021
Sorry, I should have noted I’m referring to the line 1 1
Which is underlined by a single caret, but on the command line it has 3
carets as expected.
pablogsal commentedon Sep 20, 2021
Ah, but that is a different issue. This is not PEP-657, this is a SyntaxError, so is related how those are printed, which I think is separared.
pablogsal commentedon Sep 20, 2021
Can you try a doctest that fails on something that is not a SyntaxError.
Something like:
akulakov commentedon Sep 20, 2021
Pablo: that works fine, thanks!
I will look into updating the doctest docs, and will close this issue later
today ( or you can close it if you like).
26 remaining items
miss-islington commentedon Oct 16, 2021
New changeset fe0d9e2 by Pablo Galindo Salgado in branch 'main':
bpo-45249: Fix caret location when end_offset is set to 0 (GH-28855)
fe0d9e2
miss-islington commentedon Oct 16, 2021
New changeset 5df35fa by Miss Islington (bot) in branch '3.10':
bpo-45249: Fix caret location when end_offset is set to 0 (GH-28855)
5df35fa
pythongh-89412: Add missing 3.10/11 attributes to traceback module docs
pythongh-89412: Add missing 3.10 attributes to traceback module docs
gh-89412: Add missing attributes (added in 3.10) to traceback module …
pythongh-89412: Add missing attributes (added in 3.10) to traceback m…
pythongh-89412: Add missing attributes (added in 3.10) to traceback m…
pythongh-89412: Add missing attributes (added in 3.10) to traceback m…
[3.11] gh-89412: Add missing attributes (added in 3.10) to traceback …
[3.12] gh-89412: Add missing attributes (added in 3.10) to traceback …
[3.10] gh-89412: Add missing attributes (added in 3.10) to traceback …