You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 1, 2025. It is now read-only.
repyportability exists so that Python code can make use of Repy modules. Therefore, the portability module must make the Repy API functions available in the global context. However, it is not necessary at this point to ensure performance isolation (i.e. non nannying) nor namespace separation (so that what would usually be sandboxed code cannot access the internals of the sandbox).
The current repyportability module does the former (see code), but has issues with the latter (see more code). In particular, lines 204-211 seem to allow all the builtins, but the program flow in safe.pyindicates that builtins are replaced preferrably even if they are considered OK.
Patching this behavior should be as simple as
@@ -205,6 +205,8 @@ def initialize_safe_module():
for builtin_type in dir(__builtins__):
if builtin_type not in safe._BUILTIN_OK:
safe._BUILTIN_OK.append(builtin_type)
+ if builtin_type in safe._BUILTIN_REPLACE:+ del safe._BUILTIN_REPLACE[builtin_type]