Author Naftali.Harris
Recipients Naftali.Harris, benjamin.peterson, kbk
Date 2016-12-30.18:30:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1483122644.23.0.688174559708.issue29107@psf.upfronthosting.co.za>
In-reply-to
Content
Two other minor discrepancies between the way traceback and the interpreter format SyntaxError's, in 2.7.13:

1.

>>> e = SyntaxError("some message", ("myfile.py", None, None, None))
>>> raise e
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
SyntaxError: some message (myfile.py)
>>> try:
... 	raise e
... except:
... 	traceback.print_exc()
...
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
Traceback (most recent call last):
  File "<stdin>", line 4, in <module>
  File "/Users/naftali/repos/Python-2.7.13/Lib/traceback.py", line 233, in print_exc
    print_exception(etype, value, tb, limit, file)
  File "/Users/naftali/repos/Python-2.7.13/Lib/traceback.py", line 126, in print_exception
    lines = format_exception_only(etype, value)
  File "/Users/naftali/repos/Python-2.7.13/Lib/traceback.py", line 188, in format_exception_only
    lines.append('  File "%s", line %d\n' % (filename, lineno))
TypeError: %d format: a number is required, not NoneType


2.

>>> e = SyntaxError("some message", ("myfile.py", 3, 10, "hello"))
>>> raise e
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "myfile.py", line 3
    hello
             ^
SyntaxError: some message
>>> try:
... 	raise e
... except:
... 	traceback.print_exc()
...
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
  File "myfile.py", line 3
    hello
        ^
SyntaxError: some message
History
Date User Action Args
2016-12-30 18:30:44Naftali.Harrissetrecipients: + Naftali.Harris, kbk, benjamin.peterson
2016-12-30 18:30:44Naftali.Harrissetmessageid: <1483122644.23.0.688174559708.issue29107@psf.upfronthosting.co.za>
2016-12-30 18:30:44Naftali.Harrislinkissue29107 messages
2016-12-30 18:30:44Naftali.Harriscreate