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
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:
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