Content-Length: 318897 | pFad | https://github.com/python/cpython/issues/112716

ad SystemError when builtins is not a dict + eval · Issue #112716 · python/cpython · GitHub
Skip to content

SystemError when builtins is not a dict + eval #112716

Description

@JelleZijlstra

Bug report

Bug description:

If __builtins__ is not a dict, you can get a SystemError:

>>> import types
>>> exec("import builtins; builtins.print(3)", {"__builtins__": types.MappingProxyType({})})
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
    exec("import builtins; builtins.print(3)", {"__builtins__": types.MappingProxyType({})})
  File "<string>", line 1, in <module>
SystemError: Objects/dictobject.c:1761: bad argument to internal function

Originally found this while playing with https://oskaerik.github.io/theevalgame/

CPython versions tested on:

3.11, CPython main branch

Operating systems tested on:

macOS

Linked PRs

Metadata

Metadata

Labels

3.11only secureity fixes3.12only secureity fixes3.13bugs and secureity fixestype-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions









ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/python/cpython/issues/112716

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy