-
-
Notifications
You must be signed in to change notification settings - Fork 29.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python py_compile error message inconsistent and missing newline #67999
Comments
On the following test file (test.py): class Solution:
def repeatedNumber(self, A):
test = 1
return [] Running python -m py_compile test.py return the following error message: But without a newline on stderr at the end of the message. This causes some problems with scripts that expect a newline and new my particular case with reading stderr on docker where docker just ignore the line if it doesn't end in a newline. Also, this message differs from the runtime error message:
Would it be possible to at least add in a newline and at best, change the message to be consistent with the runtime error message? I will trying to look at the code and see if I can write a patch but it will take me some time. |
I can confirm that the bugs is demonstrated by copying the text below into a normal unix text file. |
This patch adds new line symbol. For some reason py_compile module prints only SyntaxErrors with traceback. All other exceptions are printed with "Sorry:" and in one line. |
New changeset 1e139b3c489e by Berker Peksag in branch '3.4': New changeset d39fe1e112a3 by Berker Peksag in branch 'default': |
New changeset 22790c4f3b16 by Berker Peksag in branch '2.7': |
Thank you Alex. |
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: