-
-
Notifications
You must be signed in to change notification settings - Fork 33.4k
Open
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
When attempting to run py_compile using its CLI (python3 -m py_compile test.py) on file with erroneous indentation, ex:
# test.py
print("hello world")
# unexpected space characters before `print`An error will be printed to stderr, but without a newline at the end.
Although the py_compile documentation does not specify the error message format, the lack of newline is unconventional and can lead to unexpected behavior of scripts dependent on it.
The same issue was already raised twice:
- 2005 (2.7) Newline in error output of py_compile.compile #41763
- 2015 (3.4) Python py_compile error message inconsistent and missing newline #67999
in both instances the newline was added thus the lack of one now seems to be unintentional.
If this is confirmed to be a bug I will attempt to write a fix for it.
CPython versions tested on:
3.12
Operating systems tested on:
Linux
Metadata
Metadata
Assignees
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error