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: Syntax Error exception dosen't print string; not informative
Type: behavior Stage:
Components: Interpreter Core Versions: Python 3.0
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: kbk Nosy List: Dude-X, gvanrossum, kbk
Priority: high Keywords: patch

Created on 2007-12-23 21:23 by Dude-X, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
pythonrun.c.patch kbk, 2008-01-05 03:37
Messages (5)
msg58977 - (view) Author: Isaul Vargas (Dude-X) Date: 2007-12-23 21:23
Python 3.0 doesn't print the string with the carat underneath when 
there is a syntax error.

>>> if x
SyntaxError: invalid syntax (<stdin>, line1)
>>> if (x=5):
SyntaxError: invalid syntax (<stdin>, line 1)

Python 2.x behavior:

>>> if (x=5): pass
  File "<stdin>", line 1
    if (x=5): pass

>>> if x
  File "<stdin>", line 1
    if x
msg59108 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2008-01-02 23:10
Yup.  Same if the exception comes in a file.  I'll try to free up some
cycles to look into this.  Thanks for the report!
msg59278 - (view) Author: Kurt B. Kaiser (kbk) * (Python committer) Date: 2008-01-05 03:37
This short patch appears to fix the problem, please review.
msg59279 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2008-01-05 04:05
Yup, thanks! Can you submit it and close this?
msg59280 - (view) Author: Kurt B. Kaiser (kbk) * (Python committer) Date: 2008-01-05 04:33
r59729
History
Date User Action Args
2022-04-11 14:56:29adminsetgithub: 46033
2008-01-06 22:29:44adminsetkeywords: - py3k
versions: Python 3.0
2008-01-05 04:33:21kbksetstatus: open -> closed
assignee: gvanrossum -> kbk
resolution: fixed
messages: + msg59280
2008-01-05 04:05:36gvanrossumsetmessages: + msg59279
2008-01-05 03:37:38kbksetkeywords: + patch
files: + pythonrun.c.patch
messages: + msg59278
2008-01-02 23:10:55gvanrossumsetassignee: gvanrossum
messages: + msg59108
nosy: + gvanrossum
2008-01-01 14:49:08christian.heimessetpriority: high
keywords: + py3k
components: + Interpreter Core
2007-12-31 22:19:37kbksetnosy: + kbk
2007-12-23 21:23:25Dude-Xcreate