[issue29107] traceback module incorrectly formats args-less syntax errors

2020-09-18 Thread Benjamin Peterson
Change by Benjamin Peterson : -- resolution: -> out of date stage: -> resolved status: open -> closed ___ Python tracker ___ ___ P

[issue29107] traceback module incorrectly formats args-less syntax errors

2020-09-18 Thread Irit Katriel
Irit Katriel added the comment: Since this is a python 2-only issue, I think this issue can be closed. -- ___ Python tracker ___ __

[issue29107] traceback module incorrectly formats args-less syntax errors

2020-09-18 Thread Irit Katriel
Irit Katriel added the comment: As stated above, this has been fixed in python 3: ** C:\Users\User\src\cpython>type x.py def f(x): global x C:\Users\User\src\cpython>python.bat Running Release|Win32 interpreter... Python 3.10.0a0 (he

[issue29107] traceback module incorrectly formats args-less syntax errors

2017-02-02 Thread Nick Coghlan
Changes by Nick Coghlan : -- nosy: +ncoghlan ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue29107] traceback module incorrectly formats args-less syntax errors

2016-12-30 Thread Naftali Harris
Naftali Harris added the comment: Adding Georg, who is listed as an expert for the traceback module (https://docs.python.org/devguide/experts.html). -- nosy: +georg.brandl ___ Python tracker __

[issue29107] traceback module incorrectly formats args-less syntax errors

2016-12-30 Thread Naftali Harris
Naftali Harris added the comment: For your convenience, here is a possible patch fixing these issues. It modifies the format_exception_only function in the traceback module to follow the behavior of the interpreter a little more closely for SyntaxError's. Feel free to use, in whole, in part, o

[issue29107] traceback module incorrectly formats args-less syntax errors

2016-12-30 Thread Naftali Harris
Naftali Harris added the comment: 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 "", line 1, in SyntaxErr

[issue29107] traceback module incorrectly formats args-less syntax errors

2016-12-29 Thread Naftali Harris
New submission from Naftali Harris: The traceback documentation states that it "exactly mimics the behavior of the Python interpreter when it prints a stack trace." Here's a small case where it doesn't, on 2.7.13: ~/repos/Python-2.7.13$ cat example.py def f(x): global x ~/repos/Python-2.7.