Skip to content

Unexpected behavior when IndentationError raise #113079

@F-park

Description

@F-park

Bug report

Bug description:

In python 3.8

>>>     0
  File "<stdin>", line 1
    0
    ^
IndentationError: unexpected indent
>>> import sys, traceback
>>> sys.excepthook = lambda *exc_info: traceback.print_exception(*exc_info)
>>>     0
  File "<stdin>", line 1
    0
    ^
IndentationError: unexpected indent

In python 3.9 ... 3.13.0a3#e7331365b488382d906ce6733ab1349ded49c928^

>>>     0
  File "<stdin>", line 1
    0
IndentationError: unexpected indent
>>> import sys, traceback
>>> sys.excepthook = lambda *exc_info: traceback.print_exception(*exc_info)
>>>     0
  File "<stdin>", line 1
        0
    ^
IndentationError: unexpected indent

In python 3.13.0a3#e7331365b488382d906ce6733ab1349ded49c928 ... main

>>>     0
  File "<stdin>", line 1
        0
    ^
IndentationError: unexpected indent

CPython versions tested on:

3.9 ... 3.13.0a3#e7331365b488382d906ce6733ab1349ded49c928^

Operating systems tested on:

Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)topic-parsertype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions