[Python-bugs-list] [ python-Bugs-564931 ] compile traceback must include filename

noreply@sourceforge.net noreply@sourceforge.net
Thu, 04 Jul 2002 10:53:30 -0700


Bugs item #564931, was opened at 2002-06-05 17:09
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=564931&group_id=5470

Category: Python Interpreter Core
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Thomas Heller (theller)
Assigned to: Jeremy Hylton (jhylton)
Summary: compile traceback must include filename

Initial Comment:
> >>> compile("1+*3", "myfile.py", "exec")
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
>   File "<string>", line 1
>     1+*3
>       ^
> SyntaxError: invalid syntax
> >>>
> 
> Shouldn't it print "myfile.py" instead of "<string>"?

Yes.

--Guido van Rossum 


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

>Comment By: Jeremy Hylton (jhylton)
Date: 2002-07-04 17:53

Message:
Logged In: YES 
user_id=31392

It is a maze of twisty little passages that all look alike 
<wink>.  I think there is no need for 
PyParser_ParseStringFilename().  Replace each use of it 
with a call to the Flags version that passes 0 for flags.

We should redo the entire API to have simpler names 
and avoid all the flags & ex stuff in the names.  Then we 
could write a compat layer that provides all the old 
names and calls the new functions.  But you can make 
that a separate patch <wink>.



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

Comment By: Thomas Heller (theller)
Date: 2002-07-04 08:45

Message:
Logged In: YES 
user_id=11105

Uploaded patch. I had to create quite some new functions to 
pass the filename through all these calls. Maybe some 
functions could be replaced by macros?

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

Comment By: Thomas Heller (theller)
Date: 2002-07-04 08:40

Message:
Logged In: YES 
user_id=11105

I'm ready to work further on the patch. Comments appreciated!

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

Comment By: Thomas Heller (theller)
Date: 2002-06-05 18:57

Message:
Logged In: YES 
user_id=11105

To avoid any confusion: I (Thomas Heller) copied the 'Initial 
Comment' from a message posted to python-dev by Guido.

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=564931&group_id=5470