RestrictedPython is a tool that helps to define a subset of the Python language which allows to provide a program input into a trusted environment.
Questions tagged [restrictedpython]
4 questions
6
votes
2 answers
RestrictedPython: Call other functions within user-specified code?
Using Yuri Nudelman's code with the custom _import definition to specify modules to restrict serves as a good base but when calling functions within said user_code naturally due to having to whitelist everything is there any way to permit other user…

meder omuraliev
- 183,342
- 71
- 393
- 434
0
votes
0 answers
setter methods and Restricted Python
I have a class "MyClass" with a class attribute and its methods.
class MyClass:
def __init__(self):
self._my_attr = None
@property
def my_attr(self):
return self._my_attr
@my_attr.setter
def my_attr(self,…

Georg Pfolz
- 1,416
- 2
- 12
- 12
0
votes
0 answers
RestrictedPython - Name Is Not Defined
I want to safely execute some user defined code. To accomplish this, I want to use RestrictedPython to limit which modules and variables the user has access to. There are a few guidelines to the user-submitted code:
The code can use the pandas,…

user61123
- 23
- 4
0
votes
1 answer
Restrictedpython code evaluation executed in thread pool - function invoked twice
i'm using restrictedpython in my app in order to allow the "mid-skilled-user" to develop some pieces of additional code to execute as modular on-the-fly add-on.
For some architectural constraints, i have to use a thread pool in order to parallelize…

Symon
- 673
- 6
- 25