-
-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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
SystemError when builtins is not a dict + eval #112716
Comments
Simpler repro case:
|
The original issue is because the
(Pickling a list iterator involves looking up the However, other code (e.g., the implementation of |
I don't know. But for now, I would prefer to fix bugs. If we decide to remove the feature, I suppose that it should be deprecated first? |
Worth noting that the use case that brought me here is real (if a little silly): the game wants to enforce that you don't use any builtins, and it enforces that by setting |
Just to expand on this: My first implementation of the proxy inherited from |
Note that support for dict subclasses is also somewhat broken, as the code path used by
|
It's funny that this feature was originally added when trying to build a sandbox, and now it's used in a game that requires you to escape from a sandbox. |
The best features are the ones that turn out to be useful in unexpected places! |
It was raised in two cases: * in the import statement when looking up __import__ * in pickling some builtin type when looking up built-ins iter, getattr, etc.
…ct (pythonGH-112770) It was raised in two cases: * in the import statement when looking up __import__ * in pickling some builtin type when looking up built-ins iter, getattr, etc. (cherry picked from commit 1161c14) Co-authored-by: Serhiy Storchaka <[email protected]>
…ct (pythonGH-112770) It was raised in two cases: * in the import statement when looking up __import__ * in pickling some builtin type when looking up built-ins iter, getattr, etc. (cherry picked from commit 1161c14) Co-authored-by: Serhiy Storchaka <[email protected]>
…honGH-112770) It was raised in two cases: * in the import statement when looking up __import__ * in pickling some builtin type when looking up built-ins iter, getattr, etc.
…honGH-112770) It was raised in two cases: * in the import statement when looking up __import__ * in pickling some builtin type when looking up built-ins iter, getattr, etc.
…honGH-112770) It was raised in two cases: * in the import statement when looking up __import__ * in pickling some builtin type when looking up built-ins iter, getattr, etc.
Bug report
Bug description:
If
__builtins__
is not a dict, you can get a SystemError: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
The text was updated successfully, but these errors were encountered: