Issue 507477: Py_CompileString and tracebacks (original) (raw)

Issue507477

Created on 2002-01-23 12:44 by badpenguin, last changed 2022-04-10 16:04 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
demo.c badpenguin,2002-03-13 10:11 a one-screen example showing the py_compilestring/py_evalcode bug
Messages (3)
msg8962 - (view) Author: Krzysztof Zych (badpenguin) Date: 2002-01-23 12:44
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().
msg8963 - (view) Author: Jeremy Hylton (jhylton) (Python triager) Date: 2002-03-12 23:11
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.
msg8964 - (view) Author: Jeremy Hylton (jhylton) (Python triager) Date: 2002-04-20 04:21
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.
History
Date User Action Args
2022-04-10 16:04:55 admin set github: 35969
2002-01-23 12:44:30 badpenguin create