This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2015年03月30日 11:58 by akshetp, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| issue23811.patch | ashkop, 2015年04月07日 13:29 | review | ||
| Messages (6) | |||
|---|---|---|---|
| msg239598 - (view) | Author: Akshet Pandey (akshetp) | Date: 2015年03月30日 11:58 | |
On the following test file (test.py): ```python class Solution: def repeatedNumber(self, A): test = 1 return [] ``` Running python -m py_compile test.py return the following error message: Sorry: IndentationError: unexpected indent (test.py, line 6) 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: ``` File "test.py", line 6 return [] ^ IndentationError: unexpected indent ``` 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. |
|||
| msg239618 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2015年03月30日 15:58 | |
I can confirm that the bugs is demonstrated by copying the text below into a normal unix text file. |
|||
| msg240211 - (view) | Author: Alex Shkop (ashkop) * | Date: 2015年04月07日 13:29 | |
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. |
|||
| msg240921 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2015年04月14日 15:58 | |
New changeset 1e139b3c489e by Berker Peksag in branch '3.4': Issue #23811: Add missing newline to the PyCompileError error message. https://hg.python.org/cpython/rev/1e139b3c489e New changeset d39fe1e112a3 by Berker Peksag in branch 'default': Issue #23811: Add missing newline to the PyCompileError error message. https://hg.python.org/cpython/rev/d39fe1e112a3 |
|||
| msg240923 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2015年04月14日 16:02 | |
New changeset 22790c4f3b16 by Berker Peksag in branch '2.7': Issue #23811: Add missing newline to the PyCompileError error message. https://hg.python.org/cpython/rev/22790c4f3b16 |
|||
| msg240924 - (view) | Author: Berker Peksag (berker.peksag) * (Python committer) | Date: 2015年04月14日 16:03 | |
Thank you Alex. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:14 | admin | set | github: 67999 |
| 2015年04月14日 16:03:33 | berker.peksag | set | status: open -> closed nosy: + berker.peksag messages: + msg240924 resolution: fixed stage: needs patch -> resolved |
| 2015年04月14日 16:02:29 | python-dev | set | messages: + msg240923 |
| 2015年04月14日 15:58:05 | python-dev | set | nosy:
+ python-dev messages: + msg240921 |
| 2015年04月07日 13:29:30 | ashkop | set | files:
+ issue23811.patch nosy: + ashkop messages: + msg240211 keywords: + patch |
| 2015年03月30日 15:59:39 | r.david.murray | set | components: + Library (Lib), - Interpreter Core |
| 2015年03月30日 15:58:40 | r.david.murray | set | type: enhancement -> behavior versions: + Python 3.5 keywords: + easy nosy: + r.david.murray messages: + msg239618 stage: needs patch |
| 2015年03月30日 11:58:58 | akshetp | create | |