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.

classification
Title: traceback.py formats SyntaxError differently
Type: behavior Stage: needs patch
Components: Library (Lib) Versions: Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: ajaksu2, georg.brandl, nascheme
Priority: normal Keywords:

Created on 2005-10-13 18:28 by nascheme, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
traceback_diff.py nascheme, 2005-10-13 18:28
Messages (3)
msg26588 - (view) Author: Neil Schemenauer (nascheme) * (Python committer) Date: 2005-10-13 18:28
I ran into this bug while working on the AST compiler.
 The new compiler sets the "lineno" and "filename"
attributes of SyntaxErrors in more cases than the old.
 The problem is that the traceback.py module formats
SyntaxError exceptions differently than pythonrun.c
does.  Attached is a small testcase.  Notice that
traceback.py uses str() to generate the exception line
and that it includes the file and lineno in
parenthesis.  This difference confuses doctest.py.

I guess the parse_syntax_error() logic needs to be
reproduced in traceback.py.
msg83882 - (view) Author: Daniel Diniz (ajaksu2) * (Python triager) Date: 2009-03-20 22:59
Confirmed on trunk.
msg85500 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2009-04-05 14:29
Fixed in trunk in r71237, 3k in r71239.
History
Date User Action Args
2022-04-11 14:56:13adminsetgithub: 42478
2009-10-07 12:02:57amaury.forgeotdarclinkissue6962 superseder
2009-04-05 14:29:01georg.brandlsetstatus: open -> closed

nosy: + georg.brandl
messages: + msg85500

resolution: fixed
2009-03-20 22:59:43ajaksu2setversions: + Python 2.6
nosy: + ajaksu2

messages: + msg83882

type: behavior
stage: needs patch
2005-10-13 18:28:53naschemecreate