Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

end_offset is ignored in subclasses of SyntaxError (3.12-only) #111609

Closed
Labels
3.12only security fixesstdlibStandard Library Python modules in the Lib/ directorytopic-replRelated to the interactive shelltype-bugAn unexpected behavior, bug, or error
@stbech

Description

@stbech

Bug report

Bug description:

When I tried to implement a subclass ofSyntaxError, the exception details ignored theend_offset-variable and just showed one caret at the position ofoffset.

raiseSyntaxError("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
classCustomSyntaxError(SyntaxError):passraiseCustomSyntaxError("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

No one assigned

    Labels

    3.12only security fixesstdlibStandard Library Python modules in the Lib/ directorytopic-replRelated to the interactive shelltype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2026 Movatter.jp