-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Closed
Labels
3.12only security fixesonly security fixesstdlibPython modules in the Lib dirPython modules in the Lib dirtopic-replRelated to the interactive shellRelated to the interactive shelltype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
When I tried to implement a subclass of SyntaxError
, the exception details ignored the end_offset
-variable and just showed one caret at the position of offset
.
raise SyntaxError("Error message", (None, 1, 5, 'a = sin(3)', 1, 9))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<string>", line 1
a = sin(3)
^^^^
SyntaxError: Error message
class CustomSyntaxError(SyntaxError):
pass
raise CustomSyntaxError("Error message", (None, 1, 5, 'a = sin(3)', 1, 9))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<string>", line 1
a = sin(3)
^
CustomSyntaxError: Error message
CPython versions tested on:
3.11, 3.12
Operating systems tested on:
Windows
Linked PRs
Metadata
Metadata
Assignees
Labels
3.12only security fixesonly security fixesstdlibPython modules in the Lib dirPython modules in the Lib dirtopic-replRelated to the interactive shellRelated to the interactive shelltype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error