This version of RestrictedPython is incompatible with the version of Python shipped
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
restrictedpython (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
The version of RestrictedPython shipped with Ubuntu jammy (4.0b3) is 4 years old and is not compatible with the version of Python that is also shipped in release jammy (Currently 3.10.4). Trying to use it results in an exception being thrown as shown below. Manually installing RestrictedPython 5.2 with "pip3 install restrictedpytho
Python 3.10.4 (main, Jun 29 2022, 12:14:53) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from RestrictedPython import compile_restricted, limited_builtins, safe_builtins, utility_builtins
>>> value="abs(x1 - x2)"
>>> value_code = compile_
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/
result = _compile_
File "/usr/lib/
policy_
File "/usr/lib/
return visitor(node)
File "/usr/lib/
return self.node_
File "/usr/lib/
return super(Restricti
File "/usr/lib/
new_node = self.visit(
File "/usr/lib/
return visitor(node)
File "/usr/lib/
node = self.node_
File "/usr/lib/
return super(Restricti
File "/usr/lib/
new_node = self.visit(
File "/usr/lib/
return visitor(node)
File "/usr/lib/
node = self.node_
File "/usr/lib/
return super(Restricti
File "/usr/lib/
new_node = self.visit(
File "/usr/lib/
return visitor(node)
File "/usr/lib/
args=
File "/usr/lib/
raise Exception("Unknown slice type: {0}".format(
Exception: Unknown slice type: <ast.Constant object at 0x7f8e24082680>