[Python-bugs-list] [ python-Bugs-507477 ] Py_CompileString and tracebacks

noreply@sourceforge.net noreply@sourceforge.net
Fri, 19 Apr 2002 21:21:43 -0700


Bugs item #507477, was opened at 2002-01-23 12:44
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=507477&group_id=5470

Category: Python Interpreter Core
Group: Python 2.2
>Status: Closed
>Resolution: Invalid
Priority: 5
Submitted By: Krzysztof Zych (badpenguin)
Assigned to: Jeremy Hylton (jhylton)
Summary: Py_CompileString and tracebacks

Initial Comment:
The API docs say, that when compiling a string with Py_Compilestring(code, filename, start), the filename param is used to construct the code object and may appear in tracebacks. Exceptions generated from these compiled objects evaluated with PyEval_EvalCode do not show this valuable description. This does not, somehow, apply when using Python's compile() and eval().

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

>Comment By: Jeremy Hylton (jhylton)
Date: 2002-04-20 04:21

Message:
Logged In: YES 
user_id=31392

Just noticed the attached program.  PyRun_SimpleString() is
not the same as PyEval_EvalCode(), so they don't behave the
same.   In particular, PyRun... has a call to
PyErr_Print().  If you check the return value of
PyEval_EvalCode() in your demo, you'll find that it is NULL,
which indicates an error.  If you call PyErr_Print(), you'll
see the same traceback that PyRun... produces.
 

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

Comment By: Jeremy Hylton (jhylton)
Date: 2002-03-12 23:11

Message:
Logged In: YES 
user_id=31392

Can you explain in more detail what you think the bug is? 
Or are there multiple bugs?  From your description, it
sounds like something isn't right, but I can't tell exactly
what you'd like to see fixed.  A small example would help.


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

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