RestrictedPython 7.0a2.dev0__tar.gz → 7.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/CHANGES.rst +10 -6
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/PKG-INFO +13 -8
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/docs/conf.py +4 -4
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/docs/contributing/ast/python3_12.ast +12 -3
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/docs/contributing/index.rst +14 -14
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/docs/roadmap/index.rst +0 -5
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/setup.py +3 -2
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/src/RestrictedPython/transformer.py +2 -2
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/src/RestrictedPython.egg-info/PKG-INFO +13 -8
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/transformer/operators/test_arithmetic_operators.py +9 -6
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tox.ini +1 -1
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/.readthedocs.yaml +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/CONTRIBUTING.md +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/COPYRIGHT.txt +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/LICENSE.txt +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/MANIFEST.in +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/README.rst +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/buildout.cfg +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/constraints.txt +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/docs/Makefile +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/docs/changes.rst +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/docs/contributing/ast/python3_10.ast +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/docs/contributing/ast/python3_11.ast +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/docs/contributing/ast/python3_6.ast +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/docs/contributing/ast/python3_7.ast +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/docs/contributing/ast/python3_8.ast +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/docs/contributing/ast/python3_9.ast +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/docs/contributing/changes_from310to311.rst +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/docs/contributing/changes_from311to312.rst +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/docs/contributing/changes_from36to37.rst +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/docs/contributing/changes_from37to38.rst +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/docs/contributing/changes_from38to39.rst +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/docs/contributing/changes_from39to310.rst +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/docs/idea.rst +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/docs/index.rst +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/docs/install/index.rst +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/docs/logo.jpg +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/docs/make.bat +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/docs/requirements.txt +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/docs/upgrade_dependencies/index.rst +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/docs/usage/api.rst +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/docs/usage/basic_usage.rst +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/docs/usage/framework_usage.rst +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/docs/usage/index.rst +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/docs/usage/policy.rst +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/setup.cfg +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/src/RestrictedPython/Eval.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/src/RestrictedPython/Guards.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/src/RestrictedPython/Limits.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/src/RestrictedPython/PrintCollector.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/src/RestrictedPython/Utilities.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/src/RestrictedPython/__init__.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/src/RestrictedPython/_compat.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/src/RestrictedPython/compile.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/src/RestrictedPython.egg-info/SOURCES.txt +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/src/RestrictedPython.egg-info/dependency_links.txt +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/src/RestrictedPython.egg-info/not-zip-safe +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/src/RestrictedPython.egg-info/requires.txt +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/src/RestrictedPython.egg-info/top_level.txt +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/__init__.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/builtins/test_limits.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/builtins/test_utilities.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/helper.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/test_Guards.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/test_NamedExpr.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/test_Utilities.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/test_compile.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/test_compile_restricted_function.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/test_eval.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/test_imports.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/test_iterating_over_dict_items.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/test_print_function.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/transformer/operators/test_bit_wise_operators.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/transformer/operators/test_bool_operators.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/transformer/operators/test_comparison_operators.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/transformer/operators/test_identity_operators.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/transformer/operators/test_logical_operators.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/transformer/operators/test_unary_operators.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/transformer/test_assert.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/transformer/test_assign.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/transformer/test_async.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/transformer/test_attribute.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/transformer/test_augassign.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/transformer/test_base_types.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/transformer/test_breakpoint.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/transformer/test_call.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/transformer/test_classdef.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/transformer/test_comparators.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/transformer/test_conditional.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/transformer/test_dict_comprehension.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/transformer/test_eval_exec.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/transformer/test_fstring.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/transformer/test_functiondef.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/transformer/test_generic.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/transformer/test_global_local.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/transformer/test_import.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/transformer/test_inspect.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/transformer/test_iterator.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/transformer/test_lambda.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/transformer/test_loop.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/transformer/test_name.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/transformer/test_slice.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/transformer/test_subscript.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/transformer/test_try.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/transformer/test_with_stmt.py +0 -0
- {RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/transformer/test_yield.py +0 -0
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
Changes
|
|
2
2
|
=======
|
|
3
3
|
|
|
4
|
-
7.
|
|
5
|
-
|
|
4
|
+
7.1 (2024-03-14)
|
|
5
|
+
----------------
|
|
6
|
+
|
|
7
|
+
- Add support for the matmul (``@``) operator.
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
7.0 (2023-11-17)
|
|
11
|
+
----------------
|
|
6
12
|
|
|
7
13
|
Backwards incompatible changes
|
|
8
14
|
++++++++++++++++++++++++++++++
|
|
@@ -12,8 +18,7 @@ Backwards incompatible changes
|
|
|
12
18
|
Features
|
|
13
19
|
++++++++
|
|
14
20
|
|
|
15
|
-
-
|
|
16
|
-
audit has been done so far.
|
|
21
|
+
- Officially support Python 3.12.
|
|
17
22
|
|
|
18
23
|
Fixes
|
|
19
24
|
+++++
|
|
@@ -23,8 +28,7 @@ Fixes
|
|
|
23
28
|
- Forbid using some attributes providing access to restricted Python internals.
|
|
24
29
|
(CVE-2023-37271)
|
|
25
30
|
|
|
26
|
-
- Fix information disclosure problems through
|
|
27
|
-
Python's "format" functionality
|
|
31
|
+
- Fix information disclosure problems through Python's "format" functionality
|
|
28
32
|
(``format`` and ``format_map`` methods on ``str`` and its instances,
|
|
29
33
|
``string.Formatter``). (CVE-2023-41039)
|
|
30
34
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: RestrictedPython
|
|
3
|
-
Version: 7.
|
|
3
|
+
Version: 7.1
|
|
4
4
|
Summary: RestrictedPython is a defined subset of the Python language which allows to provide a program input into a trusted environment.
|
|
5
5
|
Home-page: https://github.com/zopefoundation/RestrictedPython
|
|
6
6
|
Author: Zope Foundation and Contributors
|
|
@@ -20,9 +20,10 @@ Classifier: Programming Language :: Python :: 3.8
|
|
|
20
20
|
Classifier: Programming Language :: Python :: 3.9
|
|
21
21
|
Classifier: Programming Language :: Python :: 3.10
|
|
22
22
|
Classifier: Programming Language :: Python :: 3.11
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
24
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
24
25
|
Classifier: Topic :: Security
|
|
25
|
-
Requires-Python: >=3.7, <3.
|
|
26
|
+
Requires-Python: >=3.7, <3.13
|
|
26
27
|
Description-Content-Type: text/x-rst
|
|
27
28
|
License-File: LICENSE.txt
|
|
28
29
|
Provides-Extra: test
|
|
@@ -123,8 +124,14 @@ the documentation `Contributing page
|
|
|
123
124
|
Changes
|
|
124
125
|
=======
|
|
125
126
|
|
|
126
|
-
7.
|
|
127
|
-
|
|
127
|
+
7.1 (2024-03-14)
|
|
128
|
+
----------------
|
|
129
|
+
|
|
130
|
+
- Add support for the matmul (``@``) operator.
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
7.0 (2023-11-17)
|
|
134
|
+
----------------
|
|
128
135
|
|
|
129
136
|
Backwards incompatible changes
|
|
130
137
|
++++++++++++++++++++++++++++++
|
|
@@ -134,8 +141,7 @@ Backwards incompatible changes
|
|
|
134
141
|
Features
|
|
135
142
|
++++++++
|
|
136
143
|
|
|
137
|
-
-
|
|
138
|
-
audit has been done so far.
|
|
144
|
+
- Officially support Python 3.12.
|
|
139
145
|
|
|
140
146
|
Fixes
|
|
141
147
|
+++++
|
|
@@ -145,8 +151,7 @@ Fixes
|
|
|
145
151
|
- Forbid using some attributes providing access to restricted Python internals.
|
|
146
152
|
(CVE-2023-37271)
|
|
147
153
|
|
|
148
|
-
- Fix information disclosure problems through
|
|
149
|
-
Python's "format" functionality
|
|
154
|
+
- Fix information disclosure problems through Python's "format" functionality
|
|
150
155
|
(``format`` and ``format_map`` methods on ``str`` and its instances,
|
|
151
156
|
``string.Formatter``). (CVE-2023-41039)
|
|
152
157
|
|
|
@@ -47,7 +47,7 @@ master_doc = 'index'
|
|
|
47
47
|
|
|
48
48
|
# General information about the project.
|
|
49
49
|
project = 'RestrictedPython'
|
|
50
|
-
copyright = '2017-
|
|
50
|
+
copyright = '2017-2023, Zope Foundation and Contributors'
|
|
51
51
|
author = 'The Zope & Plone developer community'
|
|
52
52
|
|
|
53
53
|
# The version info for the project you're documenting, acts as replacement for
|
|
@@ -55,9 +55,9 @@ author = 'The Zope & Plone developer community'
|
|
|
55
55
|
# built documents.
|
|
56
56
|
#
|
|
57
57
|
# The short X.Y version.
|
|
58
|
-
version = '
|
|
58
|
+
version = '7.0'
|
|
59
59
|
# The full version, including alpha/beta/rc tags.
|
|
60
|
-
release = '
|
|
60
|
+
release = '7.0'
|
|
61
61
|
|
|
62
62
|
# The language for content autogenerated by Sphinx. Refer to documentation
|
|
63
63
|
# for a list of supported languages.
|
|
@@ -217,7 +217,7 @@ html_theme = 'default'
|
|
|
217
217
|
# html_search_scorer = 'scorer.js'
|
|
218
218
|
|
|
219
219
|
# Output file base name for HTML help builder.
|
|
220
|
-
htmlhelp_basename = '
|
|
220
|
+
htmlhelp_basename = 'RestrictedPython_doc'
|
|
221
221
|
|
|
222
222
|
# -- Options for LaTeX output ---------------------------------------------
|
|
223
223
|
|
|
@@ -14,23 +14,27 @@ module Python version "3.12"
|
|
|
14
14
|
stmt* body,
|
|
15
15
|
expr* decorator_list,
|
|
16
16
|
expr? returns,
|
|
17
|
-
string? type_comment
|
|
17
|
+
string? type_comment,
|
|
18
|
+
type_param* type_params)
|
|
18
19
|
| AsyncFunctionDef(identifier name,
|
|
19
20
|
arguments args,
|
|
20
21
|
stmt* body,
|
|
21
22
|
expr* decorator_list,
|
|
22
23
|
expr? returns,
|
|
23
|
-
string? type_comment
|
|
24
|
+
string? type_comment,
|
|
25
|
+
type_param* type_params)
|
|
24
26
|
|
|
25
27
|
| ClassDef(identifier name,
|
|
26
28
|
expr* bases,
|
|
27
29
|
keyword* keywords,
|
|
28
30
|
stmt* body,
|
|
29
|
-
expr* decorator_list
|
|
31
|
+
expr* decorator_list,
|
|
32
|
+
type_param* type_params)
|
|
30
33
|
| Return(expr? value)
|
|
31
34
|
|
|
32
35
|
| Delete(expr* targets)
|
|
33
36
|
| Assign(expr* targets, expr value, string? type_comment)
|
|
37
|
+
| TypeAlias(expr name, type_param* type_params, expr value)
|
|
34
38
|
| AugAssign(expr target, operator op, expr value)
|
|
35
39
|
-- 'simple' indicates that we annotate simple name without parens
|
|
36
40
|
| AnnAssign(expr target, expr annotation, expr? value, int simple)
|
|
@@ -182,4 +186,9 @@ module Python version "3.12"
|
|
|
182
186
|
attributes (int lineno, int col_offset, int end_lineno, int end_col_offset)
|
|
183
187
|
|
|
184
188
|
type_ignore = TypeIgnore(int lineno, string tag)
|
|
189
|
+
|
|
190
|
+
type_param = TypeVar(identifier name, expr? bound)
|
|
191
|
+
| ParamSpec(identifier name)
|
|
192
|
+
| TypeVarTuple(identifier name)
|
|
193
|
+
attributes (int lineno, int col_offset, int end_lineno, int end_col_offset)
|
|
185
194
|
}
|
|
@@ -91,8 +91,8 @@ To enable a certain functionality in RestrictedPython, do the following:
|
|
|
91
91
|
* icemac
|
|
92
92
|
* loechel
|
|
93
93
|
|
|
94
|
-
Differences between
|
|
95
|
-
|
|
94
|
+
Differences between Python versions
|
|
95
|
+
-----------------------------------
|
|
96
96
|
|
|
97
97
|
A (modified style) Copy of all Abstract Grammar Definitions for the Python versions does live in this Documentation (ast Subfolder) to help finding difference quicker by comparing files.
|
|
98
98
|
|
|
@@ -152,14 +152,14 @@ The ``ast`` module consists of four areas:
|
|
|
152
152
|
A ``NodeVisitor`` is a class of a node / AST consumer, it reads the data by stepping through the tree without modifying it.
|
|
153
153
|
In contrast, a ``NodeTransformer`` (which inherits from a ``NodeVisitor``) is allowed to modify the tree and nodes.
|
|
154
154
|
|
|
155
|
-
Technical
|
|
156
|
-
|
|
155
|
+
Technical decisions on how to implement / maintain RestrictedPython (Design, Structure, Tools, ...)
|
|
156
|
+
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
157
157
|
|
|
158
158
|
RestrictedPython is a core Package of the Zope & Plone Stack.
|
|
159
159
|
Until Version 3.6 RestrictedPython was Python 2 only, and a critical blocker for Zope & Plone.
|
|
160
|
-
With RestrictedPython 4.0 an API compatible rewrite has
|
|
160
|
+
With RestrictedPython 4.0 an API compatible rewrite has happened, which supports modern Python Versions.
|
|
161
161
|
|
|
162
|
-
* Use modern python tool stack for
|
|
162
|
+
* Use modern python tool stack for maintenance and tests
|
|
163
163
|
|
|
164
164
|
* tox
|
|
165
165
|
* pytest
|
|
@@ -179,7 +179,7 @@ With RestrictedPython 4.0 an API compatible rewrite has happend, which supports
|
|
|
179
179
|
Resolve discussion about how RestrictedPython should be treat new expressions / ``ast.Nodes``.
|
|
180
180
|
This belongs to :ref:`new_python_version`.
|
|
181
181
|
|
|
182
|
-
**Option 1 - reduce
|
|
182
|
+
**Option 1 - reduce maintenance burden (preferred by icemac)**
|
|
183
183
|
|
|
184
184
|
|
|
185
185
|
All AST Nodes without an explicit ``visit_<AST Node>`` method, are denied by default.
|
|
@@ -187,7 +187,7 @@ With RestrictedPython 4.0 an API compatible rewrite has happend, which supports
|
|
|
187
187
|
|
|
188
188
|
*This is currently the promoted version.*
|
|
189
189
|
|
|
190
|
-
**Option 2 - be as
|
|
190
|
+
**Option 2 - be as explicit as possible (preferred by loechel)**
|
|
191
191
|
|
|
192
192
|
If the new AST Node should be disabled by default, add a ``visit_<AST Node>`` method such as the following:
|
|
193
193
|
|
|
@@ -237,12 +237,12 @@ Technical Backgrounds - Links to External Documentation
|
|
|
237
237
|
|
|
238
238
|
* AST Grammar of Python (`Status of Python Versions`_)
|
|
239
239
|
|
|
240
|
-
* `Python 3.12 AST`_ (
|
|
241
|
-
* `Python 3.11 AST`_ (
|
|
242
|
-
* `Python 3.10 AST`_ (
|
|
243
|
-
* `Python 3.9 AST`_ (
|
|
244
|
-
* `Python 3.8 AST`_ (
|
|
245
|
-
* `Python 3.7 AST`_ (
|
|
240
|
+
* `Python 3.12 AST`_ (EOL 2028-10)
|
|
241
|
+
* `Python 3.11 AST`_ (EOL 2027-10)
|
|
242
|
+
* `Python 3.10 AST`_ (EOL 2026-10)
|
|
243
|
+
* `Python 3.9 AST`_ (EOL 2025-10)
|
|
244
|
+
* `Python 3.8 AST`_ (EOL 2024-10)
|
|
245
|
+
* `Python 3.7 AST`_ (EOL 2023-06-27)
|
|
246
246
|
|
|
247
247
|
* `AST NodeVistiors Class`_
|
|
248
248
|
* `AST NodeTransformer Class`_
|
|
@@ -26,11 +26,6 @@ Full code coverage tests.
|
|
|
26
26
|
|
|
27
27
|
stephan-hof did propose a solution, should be discussed and if approved implemented.
|
|
28
28
|
|
|
29
|
-
RestrictedPython 4.1+
|
|
30
|
-
---------------------
|
|
31
|
-
|
|
32
|
-
Enhance RestrictedPython, declare deprecations and possible new restrictions.
|
|
33
|
-
|
|
34
29
|
RestrictedPython 6.0+
|
|
35
30
|
---------------------
|
|
36
31
|
|
|
@@ -32,7 +32,7 @@ tests_require = [
|
|
|
32
32
|
|
|
33
33
|
setup(
|
|
34
34
|
name='RestrictedPython',
|
|
35
|
-
version='7.
|
|
35
|
+
version='7.1',
|
|
36
36
|
url='https://github.com/zopefoundation/RestrictedPython',
|
|
37
37
|
license='ZPL 2.1',
|
|
38
38
|
description=(
|
|
@@ -52,6 +52,7 @@ setup(
|
|
|
52
52
|
'Programming Language :: Python :: 3.9',
|
|
53
53
|
'Programming Language :: Python :: 3.10',
|
|
54
54
|
'Programming Language :: Python :: 3.11',
|
|
55
|
+
'Programming Language :: Python :: 3.12',
|
|
55
56
|
'Programming Language :: Python :: Implementation :: CPython',
|
|
56
57
|
'Topic :: Security',
|
|
57
58
|
],
|
|
@@ -67,7 +68,7 @@ setup(
|
|
|
67
68
|
package_dir={'': 'src'},
|
|
68
69
|
install_requires=[
|
|
69
70
|
],
|
|
70
|
-
python_requires=">=3.7, <3.
|
|
71
|
+
python_requires=">=3.7, <3.13",
|
|
71
72
|
tests_require=tests_require,
|
|
72
73
|
extras_require={
|
|
73
74
|
'test': tests_require,
|
|
@@ -768,8 +768,8 @@ class RestrictingNodeTransformer(ast.NodeTransformer):
|
|
|
768
768
|
return self.node_contents_visit(node)
|
|
769
769
|
|
|
770
770
|
def visit_MatMult(self, node):
|
|
771
|
-
"""
|
|
772
|
-
self.
|
|
771
|
+
"""Allow multiplication (`@`)."""
|
|
772
|
+
return self.node_contents_visit(node)
|
|
773
773
|
|
|
774
774
|
def visit_BoolOp(self, node):
|
|
775
775
|
"""Allow bool operator without restrictions."""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: RestrictedPython
|
|
3
|
-
Version: 7.
|
|
3
|
+
Version: 7.1
|
|
4
4
|
Summary: RestrictedPython is a defined subset of the Python language which allows to provide a program input into a trusted environment.
|
|
5
5
|
Home-page: https://github.com/zopefoundation/RestrictedPython
|
|
6
6
|
Author: Zope Foundation and Contributors
|
|
@@ -20,9 +20,10 @@ Classifier: Programming Language :: Python :: 3.8
|
|
|
20
20
|
Classifier: Programming Language :: Python :: 3.9
|
|
21
21
|
Classifier: Programming Language :: Python :: 3.10
|
|
22
22
|
Classifier: Programming Language :: Python :: 3.11
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
24
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
24
25
|
Classifier: Topic :: Security
|
|
25
|
-
Requires-Python: >=3.7, <3.
|
|
26
|
+
Requires-Python: >=3.7, <3.13
|
|
26
27
|
Description-Content-Type: text/x-rst
|
|
27
28
|
License-File: LICENSE.txt
|
|
28
29
|
Provides-Extra: test
|
|
@@ -123,8 +124,14 @@ the documentation `Contributing page
|
|
|
123
124
|
Changes
|
|
124
125
|
=======
|
|
125
126
|
|
|
126
|
-
7.
|
|
127
|
-
|
|
127
|
+
7.1 (2024-03-14)
|
|
128
|
+
----------------
|
|
129
|
+
|
|
130
|
+
- Add support for the matmul (``@``) operator.
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
7.0 (2023-11-17)
|
|
134
|
+
----------------
|
|
128
135
|
|
|
129
136
|
Backwards incompatible changes
|
|
130
137
|
++++++++++++++++++++++++++++++
|
|
@@ -134,8 +141,7 @@ Backwards incompatible changes
|
|
|
134
141
|
Features
|
|
135
142
|
++++++++
|
|
136
143
|
|
|
137
|
-
-
|
|
138
|
-
audit has been done so far.
|
|
144
|
+
- Officially support Python 3.12.
|
|
139
145
|
|
|
140
146
|
Fixes
|
|
141
147
|
+++++
|
|
@@ -145,8 +151,7 @@ Fixes
|
|
|
145
151
|
- Forbid using some attributes providing access to restricted Python internals.
|
|
146
152
|
(CVE-2023-37271)
|
|
147
153
|
|
|
148
|
-
- Fix information disclosure problems through
|
|
149
|
-
Python's "format" functionality
|
|
154
|
+
- Fix information disclosure problems through Python's "format" functionality
|
|
150
155
|
(``format`` and ``format_map`` methods on ``str`` and its instances,
|
|
151
156
|
``string.Formatter``). (CVE-2023-41039)
|
|
152
157
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
from RestrictedPython import compile_restricted_eval
|
|
2
1
|
from tests.helper import restricted_eval
|
|
3
2
|
|
|
4
3
|
|
|
@@ -33,8 +32,12 @@ def test_FloorDiv():
|
|
|
33
32
|
|
|
34
33
|
|
|
35
34
|
def test_MatMult():
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
class Vector:
|
|
36
|
+
def __init__(self, values):
|
|
37
|
+
self.values = values
|
|
38
|
+
|
|
39
|
+
def __matmul__(self, other):
|
|
40
|
+
return sum(x * y for x, y in zip(self.values, other.values))
|
|
41
|
+
|
|
42
|
+
assert restricted_eval(
|
|
43
|
+
'Vector((8, 3, 5)) @ Vector((2, 7, 1))', {'Vector': Vector}) == 42
|
|
@@ -54,7 +54,7 @@ commands =
|
|
|
54
54
|
coverage combine
|
|
55
55
|
coverage html
|
|
56
56
|
coverage report -m --fail-under=100
|
|
57
|
-
depends = py37,py38,py39,py39-datetime,py310,py311,
|
|
57
|
+
depends = py37,py38,py39,py39-datetime,py310,py311,py312,coverage
|
|
58
58
|
[testenv:release-check]
|
|
59
59
|
description = ensure that the distribution is ready to release
|
|
60
60
|
basepython = python3
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/docs/contributing/changes_from310to311.rst
RENAMED
|
File without changes
|
{RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/docs/contributing/changes_from311to312.rst
RENAMED
|
File without changes
|
{RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/docs/contributing/changes_from36to37.rst
RENAMED
|
File without changes
|
{RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/docs/contributing/changes_from37to38.rst
RENAMED
|
File without changes
|
{RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/docs/contributing/changes_from38to39.rst
RENAMED
|
File without changes
|
{RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/docs/contributing/changes_from39to310.rst
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/src/RestrictedPython.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/src/RestrictedPython.egg-info/not-zip-safe
RENAMED
|
File without changes
|
{RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/src/RestrictedPython.egg-info/requires.txt
RENAMED
|
File without changes
|
{RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/src/RestrictedPython.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/test_compile_restricted_function.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/test_iterating_over_dict_items.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{RestrictedPython-7.0a2.dev0 → RestrictedPython-7.1}/tests/transformer/test_dict_comprehension.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|