Skip to content

Interpreter.call() Fails For Various Builtins #135443

Closed
@ericsnowcurrently

Description

@ericsnowcurrently

Bug report

Bug description:

This includes any function that calls _PyEval_GetGlobals() or _PyEval_GetFrameLocals(). Here's a list of the ones I noticed:

  • globals()
  • locals()
  • dir()
  • vars()
  • exec()
  • eval()

For example:

from concurrent import interpreters
interp = interpreters.create()

# This raises SystemError.
interp.call(eval, 'True')

Ideally it would fall back to __main__.__dict__ for the globals and locals.


FWIW, this is most obvious with subinterpreters, but a similar problem applies to any user of the C-API that doesn't have a frame set.

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Linked PRs

Metadata

Metadata

Labels

3.14bugs and security fixes3.15new features, bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)topic-subinterpreterstype-bugAn unexpected behavior, bug, or error

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions