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.

Author Arfrever
Recipients Arfrever, benjamin.peterson, pitrou, serhiy.storchaka
Date 2014-12-12.01:44:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1418348647.52.0.502974463654.issue23035@psf.upfronthosting.co.za>
In-reply-to
Content
When 'python -c ${command}' is used and exception other than SyntaxError occurs, then line causing exception is not shown.

Problem seen in output of last 2 commands below:

$ cat /tmp/test1
1 /
$ cat /tmp/test2
1 / 0
$ cat /tmp/test3
a
$ python3.5 /tmp/test1
  File "/tmp/test1", line 1
    1 /
      ^
SyntaxError: invalid syntax
$ python3.5 /tmp/test2
Traceback (most recent call last):
  File "/tmp/test2", line 1, in <module>
    1 / 0
ZeroDivisionError: division by zero
$ python3.5 /tmp/test3
Traceback (most recent call last):
  File "/tmp/test3", line 1, in <module>
    a
NameError: name 'a' is not defined
$ python3.5 -c '1 /'
  File "<string>", line 1
    1 /
      ^
SyntaxError: invalid syntax
$ python3.5 -c '1 / 0'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ZeroDivisionError: division by zero
$ python3.5 -c 'a'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'a' is not defined
History
Date User Action Args
2014-12-12 01:44:07Arfreversetrecipients: + Arfrever, pitrou, benjamin.peterson, serhiy.storchaka
2014-12-12 01:44:07Arfreversetmessageid: <1418348647.52.0.502974463654.issue23035@psf.upfronthosting.co.za>
2014-12-12 01:44:07Arfreverlinkissue23035 messages
2014-12-12 01:44:05Arfrevercreate