Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Py_CompileString and tracebacks #35969

Closed
badpenguin mannequin opened this issue Jan 23, 2002 · 3 comments
Closed

Py_CompileString and tracebacks #35969

badpenguin mannequin opened this issue Jan 23, 2002 · 3 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@badpenguin
Copy link
Mannequin

badpenguin mannequin commented Jan 23, 2002

BPO 507477
Files
  • demo.c: a one-screen example showing the py_compilestring/py_evalcode bug
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2002-04-20.04:21:43.000>
    created_at = <Date 2002-01-23.12:44:30.000>
    labels = ['interpreter-core', 'invalid']
    title = 'Py_CompileString and tracebacks'
    updated_at = <Date 2002-04-20.04:21:43.000>
    user = 'https://bugs.python.org/badpenguin'

    bugs.python.org fields:

    activity = <Date 2002-04-20.04:21:43.000>
    actor = 'jhylton'
    assignee = 'jhylton'
    closed = True
    closed_date = None
    closer = None
    components = ['Interpreter Core']
    creation = <Date 2002-01-23.12:44:30.000>
    creator = 'badpenguin'
    dependencies = []
    files = ['308']
    hgrepos = []
    issue_num = 507477
    keywords = []
    message_count = 3.0
    messages = ['8962', '8963', '8964']
    nosy_count = 2.0
    nosy_names = ['jhylton', 'badpenguin']
    pr_nums = []
    priority = 'normal'
    resolution = 'not a bug'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue507477'
    versions = ['Python 2.2']

    @badpenguin
    Copy link
    Mannequin Author

    badpenguin mannequin commented Jan 23, 2002

    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().

    @badpenguin badpenguin mannequin closed this as completed Jan 23, 2002
    @badpenguin badpenguin mannequin added the invalid label Jan 23, 2002
    @badpenguin badpenguin mannequin assigned jhylton Jan 23, 2002
    @badpenguin badpenguin mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Jan 23, 2002
    @badpenguin badpenguin mannequin closed this as completed Jan 23, 2002
    @badpenguin badpenguin mannequin added the invalid label Jan 23, 2002
    @badpenguin badpenguin mannequin assigned jhylton Jan 23, 2002
    @badpenguin badpenguin mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Jan 23, 2002
    @jhylton
    Copy link
    Mannequin

    jhylton mannequin commented Mar 12, 2002

    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.

    @jhylton
    Copy link
    Mannequin

    jhylton mannequin commented Apr 20, 2002

    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.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    interpreter-core (Objects, Python, Grammar, and Parser dirs)
    Projects
    None yet
    Development

    No branches or pull requests

    0 participants