[Idle-dev] [ idlefork-Bugs-629983 ] SyntaxError in module reported poorly

noreply@sourceforge.net noreply@sourceforge.net
Mon, 28 Oct 2002 09:24:04 -0800


Bugs item #629983, was opened at 2002-10-28 12:24
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109579&aid=629983&group_id=9579

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Guido van Rossum (gvanrossum)
Assigned to: Nobody/Anonymous (nobody)
Summary: SyntaxError in module reported poorly

Initial Comment:
When an imported module contains a syntax error, the
traceback doesn't properly show the line with the
error.  Example:

>>> import foo
Traceback (most recent call last):
  File "<pyshell#2>", line 1, in ?
    import foo
SyntaxError: invalid syntax ('foo.py', 1, 3, '1/\n')
>>> 

The regular Python interpreter reports this:

Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "foo.py", line 1
    1/
     ^
SyntaxError: invalid syntax
>>> 

And IDLE 0.8 similarly:

>>> import foo
Traceback (most recent call last):
  File "<pyshell#0>", line 1, in ?
    import foo
  File "/home/guido/trunk/Tools/idle/foo.py", line 1
    1/
      ^
SyntaxError: invalid syntax
>>> 


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109579&aid=629983&group_id=9579