RestrictedPython 7.4__tar.gz → 8.0__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.
Files changed (127) hide show
  1. {restrictedpython-7.4 → restrictedpython-8.0}/.pre-commit-config.yaml +2 -2
  2. {restrictedpython-7.4 → restrictedpython-8.0}/CHANGES.rst +21 -0
  3. {restrictedpython-7.4 → restrictedpython-8.0}/PKG-INFO +24 -4
  4. {restrictedpython-7.4 → restrictedpython-8.0}/docs/conf.py +2 -3
  5. {restrictedpython-7.4 → restrictedpython-8.0}/docs/contributing/index.rst +5 -11
  6. {restrictedpython-7.4 → restrictedpython-8.0}/docs/index.rst +1 -1
  7. {restrictedpython-7.4 → restrictedpython-8.0}/pyproject.toml +2 -2
  8. {restrictedpython-7.4 → restrictedpython-8.0}/setup.py +3 -4
  9. {restrictedpython-7.4 → restrictedpython-8.0}/src/RestrictedPython/Guards.py +0 -4
  10. {restrictedpython-7.4 → restrictedpython-8.0}/src/RestrictedPython/transformer.py +2 -2
  11. {restrictedpython-7.4 → restrictedpython-8.0}/src/RestrictedPython.egg-info/PKG-INFO +24 -4
  12. {restrictedpython-7.4 → restrictedpython-8.0}/src/RestrictedPython.egg-info/SOURCES.txt +0 -22
  13. {restrictedpython-7.4 → restrictedpython-8.0}/tests/transformer/test_try.py +7 -13
  14. {restrictedpython-7.4 → restrictedpython-8.0}/tox.ini +3 -4
  15. restrictedpython-7.4/docs/_build/doctest/output.txt +0 -35
  16. restrictedpython-7.4/docs/_build/html/_sources/changes.rst.txt +0 -1
  17. restrictedpython-7.4/docs/_build/html/_sources/contributing/changes_from310to311.rst.txt +0 -5
  18. restrictedpython-7.4/docs/_build/html/_sources/contributing/changes_from311to312.rst.txt +0 -5
  19. restrictedpython-7.4/docs/_build/html/_sources/contributing/changes_from312to313.rst.txt +0 -5
  20. restrictedpython-7.4/docs/_build/html/_sources/contributing/changes_from37to38.rst.txt +0 -5
  21. restrictedpython-7.4/docs/_build/html/_sources/contributing/changes_from38to39.rst.txt +0 -5
  22. restrictedpython-7.4/docs/_build/html/_sources/contributing/changes_from39to310.rst.txt +0 -5
  23. restrictedpython-7.4/docs/_build/html/_sources/contributing/index.rst.txt +0 -308
  24. restrictedpython-7.4/docs/_build/html/_sources/idea.rst.txt +0 -85
  25. restrictedpython-7.4/docs/_build/html/_sources/index.rst.txt +0 -42
  26. restrictedpython-7.4/docs/_build/html/_sources/install/index.rst.txt +0 -10
  27. restrictedpython-7.4/docs/_build/html/_sources/roadmap/index.rst.txt +0 -33
  28. restrictedpython-7.4/docs/_build/html/_sources/usage/api.rst.txt +0 -139
  29. restrictedpython-7.4/docs/_build/html/_sources/usage/basic_usage.rst.txt +0 -175
  30. restrictedpython-7.4/docs/_build/html/_sources/usage/framework_usage.rst.txt +0 -86
  31. restrictedpython-7.4/docs/_build/html/_sources/usage/index.rst.txt +0 -9
  32. restrictedpython-7.4/docs/_build/html/_sources/usage/policy.rst.txt +0 -237
  33. restrictedpython-7.4/docs/_build/html/_static/scripts/furo.js.LICENSE.txt +0 -7
  34. restrictedpython-7.4/docs/contributing/ast/python3_7.ast +0 -175
  35. restrictedpython-7.4/docs/contributing/changes_from37to38.rst +0 -5
  36. restrictedpython-7.4/docs/logo.jpg +0 -0
  37. {restrictedpython-7.4 → restrictedpython-8.0}/.readthedocs.yaml +0 -0
  38. {restrictedpython-7.4 → restrictedpython-8.0}/CONTRIBUTING.md +0 -0
  39. {restrictedpython-7.4 → restrictedpython-8.0}/COPYRIGHT.txt +0 -0
  40. {restrictedpython-7.4 → restrictedpython-8.0}/LICENSE.txt +0 -0
  41. {restrictedpython-7.4 → restrictedpython-8.0}/MANIFEST.in +0 -0
  42. {restrictedpython-7.4 → restrictedpython-8.0}/README.rst +0 -0
  43. {restrictedpython-7.4 → restrictedpython-8.0}/buildout.cfg +0 -0
  44. {restrictedpython-7.4 → restrictedpython-8.0}/constraints.txt +0 -0
  45. {restrictedpython-7.4 → restrictedpython-8.0}/docs/Makefile +0 -0
  46. {restrictedpython-7.4 → restrictedpython-8.0}/docs/changes.rst +0 -0
  47. {restrictedpython-7.4 → restrictedpython-8.0}/docs/contributing/ast/python3_10.ast +0 -0
  48. {restrictedpython-7.4 → restrictedpython-8.0}/docs/contributing/ast/python3_11.ast +0 -0
  49. {restrictedpython-7.4 → restrictedpython-8.0}/docs/contributing/ast/python3_12.ast +0 -0
  50. {restrictedpython-7.4 → restrictedpython-8.0}/docs/contributing/ast/python3_13.ast +0 -0
  51. {restrictedpython-7.4 → restrictedpython-8.0}/docs/contributing/ast/python3_8.ast +0 -0
  52. {restrictedpython-7.4 → restrictedpython-8.0}/docs/contributing/ast/python3_9.ast +0 -0
  53. {restrictedpython-7.4 → restrictedpython-8.0}/docs/contributing/changes_from310to311.rst +0 -0
  54. {restrictedpython-7.4 → restrictedpython-8.0}/docs/contributing/changes_from311to312.rst +0 -0
  55. {restrictedpython-7.4 → restrictedpython-8.0}/docs/contributing/changes_from312to313.rst +0 -0
  56. {restrictedpython-7.4 → restrictedpython-8.0}/docs/contributing/changes_from38to39.rst +0 -0
  57. {restrictedpython-7.4 → restrictedpython-8.0}/docs/contributing/changes_from39to310.rst +0 -0
  58. {restrictedpython-7.4 → restrictedpython-8.0}/docs/idea.rst +0 -0
  59. {restrictedpython-7.4 → restrictedpython-8.0}/docs/install/index.rst +0 -0
  60. {restrictedpython-7.4/docs/_build/html/_images → restrictedpython-8.0/docs}/logo.jpg +0 -0
  61. {restrictedpython-7.4 → restrictedpython-8.0}/docs/make.bat +0 -0
  62. {restrictedpython-7.4 → restrictedpython-8.0}/docs/requirements.txt +0 -0
  63. {restrictedpython-7.4 → restrictedpython-8.0}/docs/roadmap/index.rst +0 -0
  64. {restrictedpython-7.4 → restrictedpython-8.0}/docs/usage/api.rst +0 -0
  65. {restrictedpython-7.4 → restrictedpython-8.0}/docs/usage/basic_usage.rst +0 -0
  66. {restrictedpython-7.4 → restrictedpython-8.0}/docs/usage/framework_usage.rst +0 -0
  67. {restrictedpython-7.4 → restrictedpython-8.0}/docs/usage/index.rst +0 -0
  68. {restrictedpython-7.4 → restrictedpython-8.0}/docs/usage/policy.rst +0 -0
  69. {restrictedpython-7.4 → restrictedpython-8.0}/setup.cfg +0 -0
  70. {restrictedpython-7.4 → restrictedpython-8.0}/src/RestrictedPython/Eval.py +0 -0
  71. {restrictedpython-7.4 → restrictedpython-8.0}/src/RestrictedPython/Limits.py +0 -0
  72. {restrictedpython-7.4 → restrictedpython-8.0}/src/RestrictedPython/PrintCollector.py +0 -0
  73. {restrictedpython-7.4 → restrictedpython-8.0}/src/RestrictedPython/Utilities.py +0 -0
  74. {restrictedpython-7.4 → restrictedpython-8.0}/src/RestrictedPython/__init__.py +0 -0
  75. {restrictedpython-7.4 → restrictedpython-8.0}/src/RestrictedPython/_compat.py +0 -0
  76. {restrictedpython-7.4 → restrictedpython-8.0}/src/RestrictedPython/compile.py +0 -0
  77. {restrictedpython-7.4 → restrictedpython-8.0}/src/RestrictedPython.egg-info/dependency_links.txt +0 -0
  78. {restrictedpython-7.4 → restrictedpython-8.0}/src/RestrictedPython.egg-info/not-zip-safe +0 -0
  79. {restrictedpython-7.4 → restrictedpython-8.0}/src/RestrictedPython.egg-info/requires.txt +0 -0
  80. {restrictedpython-7.4 → restrictedpython-8.0}/src/RestrictedPython.egg-info/top_level.txt +0 -0
  81. {restrictedpython-7.4 → restrictedpython-8.0}/tests/__init__.py +0 -0
  82. {restrictedpython-7.4 → restrictedpython-8.0}/tests/builtins/test_limits.py +0 -0
  83. {restrictedpython-7.4 → restrictedpython-8.0}/tests/builtins/test_utilities.py +0 -0
  84. {restrictedpython-7.4 → restrictedpython-8.0}/tests/helper.py +0 -0
  85. {restrictedpython-7.4 → restrictedpython-8.0}/tests/test_Guards.py +0 -0
  86. {restrictedpython-7.4 → restrictedpython-8.0}/tests/test_NamedExpr.py +0 -0
  87. {restrictedpython-7.4 → restrictedpython-8.0}/tests/test_Utilities.py +0 -0
  88. {restrictedpython-7.4 → restrictedpython-8.0}/tests/test_compile.py +0 -0
  89. {restrictedpython-7.4 → restrictedpython-8.0}/tests/test_compile_restricted_function.py +0 -0
  90. {restrictedpython-7.4 → restrictedpython-8.0}/tests/test_eval.py +0 -0
  91. {restrictedpython-7.4 → restrictedpython-8.0}/tests/test_imports.py +0 -0
  92. {restrictedpython-7.4 → restrictedpython-8.0}/tests/test_iterating_over_dict_items.py +0 -0
  93. {restrictedpython-7.4 → restrictedpython-8.0}/tests/test_print_function.py +0 -0
  94. {restrictedpython-7.4 → restrictedpython-8.0}/tests/transformer/operators/test_arithmetic_operators.py +0 -0
  95. {restrictedpython-7.4 → restrictedpython-8.0}/tests/transformer/operators/test_bit_wise_operators.py +0 -0
  96. {restrictedpython-7.4 → restrictedpython-8.0}/tests/transformer/operators/test_bool_operators.py +0 -0
  97. {restrictedpython-7.4 → restrictedpython-8.0}/tests/transformer/operators/test_comparison_operators.py +0 -0
  98. {restrictedpython-7.4 → restrictedpython-8.0}/tests/transformer/operators/test_identity_operators.py +0 -0
  99. {restrictedpython-7.4 → restrictedpython-8.0}/tests/transformer/operators/test_logical_operators.py +0 -0
  100. {restrictedpython-7.4 → restrictedpython-8.0}/tests/transformer/operators/test_unary_operators.py +0 -0
  101. {restrictedpython-7.4 → restrictedpython-8.0}/tests/transformer/test_assert.py +0 -0
  102. {restrictedpython-7.4 → restrictedpython-8.0}/tests/transformer/test_assign.py +0 -0
  103. {restrictedpython-7.4 → restrictedpython-8.0}/tests/transformer/test_async.py +0 -0
  104. {restrictedpython-7.4 → restrictedpython-8.0}/tests/transformer/test_attribute.py +0 -0
  105. {restrictedpython-7.4 → restrictedpython-8.0}/tests/transformer/test_augassign.py +0 -0
  106. {restrictedpython-7.4 → restrictedpython-8.0}/tests/transformer/test_base_types.py +0 -0
  107. {restrictedpython-7.4 → restrictedpython-8.0}/tests/transformer/test_breakpoint.py +0 -0
  108. {restrictedpython-7.4 → restrictedpython-8.0}/tests/transformer/test_call.py +0 -0
  109. {restrictedpython-7.4 → restrictedpython-8.0}/tests/transformer/test_classdef.py +0 -0
  110. {restrictedpython-7.4 → restrictedpython-8.0}/tests/transformer/test_comparators.py +0 -0
  111. {restrictedpython-7.4 → restrictedpython-8.0}/tests/transformer/test_conditional.py +0 -0
  112. {restrictedpython-7.4 → restrictedpython-8.0}/tests/transformer/test_dict_comprehension.py +0 -0
  113. {restrictedpython-7.4 → restrictedpython-8.0}/tests/transformer/test_eval_exec.py +0 -0
  114. {restrictedpython-7.4 → restrictedpython-8.0}/tests/transformer/test_fstring.py +0 -0
  115. {restrictedpython-7.4 → restrictedpython-8.0}/tests/transformer/test_functiondef.py +0 -0
  116. {restrictedpython-7.4 → restrictedpython-8.0}/tests/transformer/test_generic.py +0 -0
  117. {restrictedpython-7.4 → restrictedpython-8.0}/tests/transformer/test_global_local.py +0 -0
  118. {restrictedpython-7.4 → restrictedpython-8.0}/tests/transformer/test_import.py +0 -0
  119. {restrictedpython-7.4 → restrictedpython-8.0}/tests/transformer/test_inspect.py +0 -0
  120. {restrictedpython-7.4 → restrictedpython-8.0}/tests/transformer/test_iterator.py +0 -0
  121. {restrictedpython-7.4 → restrictedpython-8.0}/tests/transformer/test_lambda.py +0 -0
  122. {restrictedpython-7.4 → restrictedpython-8.0}/tests/transformer/test_loop.py +0 -0
  123. {restrictedpython-7.4 → restrictedpython-8.0}/tests/transformer/test_name.py +0 -0
  124. {restrictedpython-7.4 → restrictedpython-8.0}/tests/transformer/test_slice.py +0 -0
  125. {restrictedpython-7.4 → restrictedpython-8.0}/tests/transformer/test_subscript.py +0 -0
  126. {restrictedpython-7.4 → restrictedpython-8.0}/tests/transformer/test_with_stmt.py +0 -0
  127. {restrictedpython-7.4 → restrictedpython-8.0}/tests/transformer/test_yield.py +0 -0
@@ -12,10 +12,10 @@ repos:
12
12
  - id: autopep8
13
13
  args: [--in-place, --aggressive, --aggressive]
14
14
  - repo: https://github.com/asottile/pyupgrade
15
- rev: v3.17.0
15
+ rev: v3.19.0
16
16
  hooks:
17
17
  - id: pyupgrade
18
- args: [--py38-plus]
18
+ args: [--py39-plus]
19
19
  - repo: https://github.com/isidentical/teyit
20
20
  rev: 0.4.3
21
21
  hooks:
@@ -1,6 +1,27 @@
1
1
  Changes
2
2
  =======
3
3
 
4
+ 8.0 (2025-01-23)
5
+ ----------------
6
+
7
+ Backwards incompatible changes
8
+ ++++++++++++++++++++++++++++++
9
+
10
+ - Disallow ``try/except*`` clauses due to a possible sandbox escape and
11
+ probable uselessness of this feature in the context of ``RestrictedPython``.
12
+ In addition, remove ``ExceptionGroup`` from ``safe_builtins`` (as useful only
13
+ with ``try/except*``). - This feature was introduced into
14
+ ``RestrictedPython`` in version 6.0 for Python 3.11+. (CVE-2025-22153)
15
+
16
+ - Drop support for Python 3.8.
17
+
18
+ Features
19
+ ++++++++
20
+
21
+ - Update setuptools version pin.
22
+ (`#292 <https://github.com/zopefoundation/RestrictedPython/issues/292>`_)
23
+
24
+
4
25
  7.4 (2024-10-09)
5
26
  ----------------
6
27
 
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: RestrictedPython
3
- Version: 7.4
3
+ Version: 8.0
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
7
7
  Author-email: zope-dev@zope.dev
8
- License: ZPL 2.1
8
+ License: ZPL-2.1
9
9
  Project-URL: Documentation, https://restrictedpython.readthedocs.io/
10
10
  Project-URL: Source, https://github.com/zopefoundation/RestrictedPython
11
11
  Project-URL: Tracker, https://github.com/zopefoundation/RestrictedPython/issues
@@ -15,7 +15,6 @@ Classifier: License :: OSI Approved :: Zope Public License
15
15
  Classifier: Programming Language :: Python
16
16
  Classifier: Operating System :: OS Independent
17
17
  Classifier: Programming Language :: Python :: 3
18
- Classifier: Programming Language :: Python :: 3.8
19
18
  Classifier: Programming Language :: Python :: 3.9
20
19
  Classifier: Programming Language :: Python :: 3.10
21
20
  Classifier: Programming Language :: Python :: 3.11
@@ -23,7 +22,7 @@ Classifier: Programming Language :: Python :: 3.12
23
22
  Classifier: Programming Language :: Python :: 3.13
24
23
  Classifier: Programming Language :: Python :: Implementation :: CPython
25
24
  Classifier: Topic :: Security
26
- Requires-Python: >=3.8, <3.14
25
+ Requires-Python: >=3.9, <3.14
27
26
  Description-Content-Type: text/x-rst
28
27
  License-File: LICENSE.txt
29
28
  Provides-Extra: test
@@ -124,6 +123,27 @@ the documentation `Contributing page
124
123
  Changes
125
124
  =======
126
125
 
126
+ 8.0 (2025-01-23)
127
+ ----------------
128
+
129
+ Backwards incompatible changes
130
+ ++++++++++++++++++++++++++++++
131
+
132
+ - Disallow ``try/except*`` clauses due to a possible sandbox escape and
133
+ probable uselessness of this feature in the context of ``RestrictedPython``.
134
+ In addition, remove ``ExceptionGroup`` from ``safe_builtins`` (as useful only
135
+ with ``try/except*``). - This feature was introduced into
136
+ ``RestrictedPython`` in version 6.0 for Python 3.11+. (CVE-2025-22153)
137
+
138
+ - Drop support for Python 3.8.
139
+
140
+ Features
141
+ ++++++++
142
+
143
+ - Update setuptools version pin.
144
+ (`#292 <https://github.com/zopefoundation/RestrictedPython/issues/292>`_)
145
+
146
+
127
147
  7.4 (2024-10-09)
128
148
  ----------------
129
149
 
@@ -60,9 +60,9 @@ author = 'The Zope & Plone developer community'
60
60
  # built documents.
61
61
  #
62
62
  # The short X.Y version.
63
- version = '7.4'
63
+ version = '7.5'
64
64
  # The full version, including alpha/beta/rc tags.
65
- release = '7.4'
65
+ release = '7.5'
66
66
 
67
67
  # The language for content autogenerated by Sphinx. Refer to documentation
68
68
  # for a list of supported languages.
@@ -112,7 +112,6 @@ todo_include_todos = True
112
112
  # Intersphinx Mapping for Links between different Documentations
113
113
  intersphinx_mapping = {
114
114
  'python3': ('https://docs.python.org/3', None),
115
- 'python38': ('https://docs.python.org/3.8', None),
116
115
  'python39': ('https://docs.python.org/3.9', None),
117
116
  'python310': ('https://docs.python.org/3.10', None),
118
117
  'python311': ('https://docs.python.org/3.11', None),
@@ -98,7 +98,6 @@ A (modified style) Copy of all Abstract Grammar Definitions for the Python versi
98
98
  .. toctree::
99
99
  :maxdepth: 2
100
100
 
101
- changes_from37to38
102
101
  changes_from38to39
103
102
  changes_from39to310
104
103
  changes_from310to311
@@ -236,12 +235,11 @@ Technical Backgrounds - Links to External Documentation
236
235
 
237
236
  * AST Grammar of Python (`Status of Python Versions`_)
238
237
 
238
+ * `Python 3.13 AST`_ (EOL 2029-10)
239
239
  * `Python 3.12 AST`_ (EOL 2028-10)
240
240
  * `Python 3.11 AST`_ (EOL 2027-10)
241
241
  * `Python 3.10 AST`_ (EOL 2026-10)
242
242
  * `Python 3.9 AST`_ (EOL 2025-10)
243
- * `Python 3.8 AST`_ (EOL 2024-10)
244
- * `Python 3.7 AST`_ (EOL 2023-06-27)
245
243
 
246
244
  * `AST NodeVistiors Class`_
247
245
  * `AST NodeTransformer Class`_
@@ -259,6 +257,8 @@ Todos
259
257
 
260
258
  .. _`What's new in Python`: https://docs.python.org/3/whatsnew/
261
259
 
260
+ .. _`What's new in Python 3.13`: https://docs.python.org/3.13/whatsnew/3.13.html
261
+
262
262
  .. _`What's new in Python 3.12`: https://docs.python.org/3.12/whatsnew/3.12.html
263
263
 
264
264
  .. _`What's new in Python 3.11`: https://docs.python.org/3.11/whatsnew/3.11.html
@@ -267,10 +267,6 @@ Todos
267
267
 
268
268
  .. _`What's new in Python 3.9`: https://docs.python.org/3.9/whatsnew/3.9.html
269
269
 
270
- .. _`What's new in Python 3.8`: https://docs.python.org/3.8/whatsnew/3.8.html
271
-
272
- .. _`What's new in Python 3.7`: https://docs.python.org/3.7/whatsnew/3.7.html
273
-
274
270
  .. _`Status of Python Versions`: https://devguide.python.org/versions/
275
271
 
276
272
  .. _`Concept of Immutable Types and Python Example`: https://en.wikipedia.org/wiki/Immutable_object#Python
@@ -285,6 +281,8 @@ Todos
285
281
 
286
282
  .. _`Python 3 AST`: https://docs.python.org/3/library/ast.html#abstract-grammar
287
283
 
284
+ .. _`Python 3.13 AST`: https://docs.python.org/3.13/library/ast.html#abstract-grammar
285
+
288
286
  .. _`Python 3.12 AST`: https://docs.python.org/3.12/library/ast.html#abstract-grammar
289
287
 
290
288
  .. _`Python 3.11 AST`: https://docs.python.org/3.11/library/ast.html#abstract-grammar
@@ -293,10 +291,6 @@ Todos
293
291
 
294
292
  .. _`Python 3.9 AST`: https://docs.python.org/3.9/library/ast.html#abstract-grammar
295
293
 
296
- .. _`Python 3.8 AST`: https://docs.python.org/3.8/library/ast.html#abstract-grammar
297
-
298
- .. _`Python 3.7 AST`: https://docs.python.org/3.7/library/ast.html#abstract-grammar
299
-
300
294
  .. _`AST NodeVistiors Class`: https://docs.python.org/3/library/ast.html#ast.NodeVisitor
301
295
 
302
296
  .. _`AST NodeTransformer Class`: https://docs.python.org/3/library/ast.html#ast.NodeTransformer
@@ -15,7 +15,7 @@ RestrictedPython is not a sandbox system or a secured environment, but it helps
15
15
  Supported Python versions
16
16
  =========================
17
17
 
18
- RestrictedPython supports CPython 3.7 up to 3.12.
18
+ RestrictedPython supports CPython 3.9 up to 3.13.
19
19
  It does _not_ support PyPy or other alternative Python implementations.
20
20
 
21
21
  Contents
@@ -3,7 +3,7 @@
3
3
  # https://github.com/zopefoundation/meta/tree/master/config/pure-python
4
4
 
5
5
  [build-system]
6
- requires = ["setuptools<74"]
6
+ requires = ["setuptools <= 75.6.0"]
7
7
  build-backend = "setuptools.build_meta"
8
8
 
9
9
  [tool.coverage.run]
@@ -11,7 +11,7 @@ branch = true
11
11
  source = ["RestrictedPython"]
12
12
 
13
13
  [tool.coverage.report]
14
- fail_under = 97.9
14
+ fail_under = 97.3
15
15
  precision = 2
16
16
  ignore_errors = true
17
17
  show_missing = true
@@ -25,9 +25,9 @@ def read(*rnames):
25
25
 
26
26
 
27
27
  setup(name='RestrictedPython',
28
- version='7.4',
28
+ version='8.0',
29
29
  url='https://github.com/zopefoundation/RestrictedPython',
30
- license='ZPL 2.1',
30
+ license='ZPL-2.1',
31
31
  description=(
32
32
  'RestrictedPython is a defined subset of the Python language which '
33
33
  'allows to provide a program input into a trusted environment.'),
@@ -39,7 +39,6 @@ setup(name='RestrictedPython',
39
39
  'Programming Language :: Python',
40
40
  'Operating System :: OS Independent',
41
41
  'Programming Language :: Python :: 3',
42
- 'Programming Language :: Python :: 3.8',
43
42
  'Programming Language :: Python :: 3.9',
44
43
  'Programming Language :: Python :: 3.10',
45
44
  'Programming Language :: Python :: 3.11',
@@ -60,7 +59,7 @@ setup(name='RestrictedPython',
60
59
  packages=find_packages('src'),
61
60
  package_dir={'': 'src'},
62
61
  install_requires=[],
63
- python_requires=">=3.8, <3.14",
62
+ python_requires=">=3.9, <3.14",
64
63
  extras_require={
65
64
  'test': ['pytest', 'pytest-mock'],
66
65
  'docs': ['Sphinx', 'furo'],
@@ -17,7 +17,6 @@
17
17
 
18
18
  import builtins
19
19
 
20
- from RestrictedPython._compat import IS_PY311_OR_GREATER
21
20
  from RestrictedPython.transformer import INSPECT_ATTRIBUTES
22
21
 
23
22
 
@@ -106,9 +105,6 @@ _safe_exceptions = [
106
105
  'ZeroDivisionError',
107
106
  ]
108
107
 
109
- if IS_PY311_OR_GREATER:
110
- _safe_exceptions.append("ExceptionGroup")
111
-
112
108
  for name in _safe_names:
113
109
  safe_builtins[name] = getattr(builtins, name)
114
110
 
@@ -1141,8 +1141,8 @@ class RestrictingNodeTransformer(ast.NodeTransformer):
1141
1141
  return self.node_contents_visit(node)
1142
1142
 
1143
1143
  def visit_TryStar(self, node):
1144
- """Allow `ExceptionGroup` without restrictions."""
1145
- return self.node_contents_visit(node)
1144
+ """Disallow `ExceptionGroup` due to a potential sandbox escape."""
1145
+ self.not_allowed(node)
1146
1146
 
1147
1147
  def visit_ExceptHandler(self, node):
1148
1148
  """Protect exception handlers."""
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: RestrictedPython
3
- Version: 7.4
3
+ Version: 8.0
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
7
7
  Author-email: zope-dev@zope.dev
8
- License: ZPL 2.1
8
+ License: ZPL-2.1
9
9
  Project-URL: Documentation, https://restrictedpython.readthedocs.io/
10
10
  Project-URL: Source, https://github.com/zopefoundation/RestrictedPython
11
11
  Project-URL: Tracker, https://github.com/zopefoundation/RestrictedPython/issues
@@ -15,7 +15,6 @@ Classifier: License :: OSI Approved :: Zope Public License
15
15
  Classifier: Programming Language :: Python
16
16
  Classifier: Operating System :: OS Independent
17
17
  Classifier: Programming Language :: Python :: 3
18
- Classifier: Programming Language :: Python :: 3.8
19
18
  Classifier: Programming Language :: Python :: 3.9
20
19
  Classifier: Programming Language :: Python :: 3.10
21
20
  Classifier: Programming Language :: Python :: 3.11
@@ -23,7 +22,7 @@ Classifier: Programming Language :: Python :: 3.12
23
22
  Classifier: Programming Language :: Python :: 3.13
24
23
  Classifier: Programming Language :: Python :: Implementation :: CPython
25
24
  Classifier: Topic :: Security
26
- Requires-Python: >=3.8, <3.14
25
+ Requires-Python: >=3.9, <3.14
27
26
  Description-Content-Type: text/x-rst
28
27
  License-File: LICENSE.txt
29
28
  Provides-Extra: test
@@ -124,6 +123,27 @@ the documentation `Contributing page
124
123
  Changes
125
124
  =======
126
125
 
126
+ 8.0 (2025-01-23)
127
+ ----------------
128
+
129
+ Backwards incompatible changes
130
+ ++++++++++++++++++++++++++++++
131
+
132
+ - Disallow ``try/except*`` clauses due to a possible sandbox escape and
133
+ probable uselessness of this feature in the context of ``RestrictedPython``.
134
+ In addition, remove ``ExceptionGroup`` from ``safe_builtins`` (as useful only
135
+ with ``try/except*``). - This feature was introduced into
136
+ ``RestrictedPython`` in version 6.0 for Python 3.11+. (CVE-2025-22153)
137
+
138
+ - Drop support for Python 3.8.
139
+
140
+ Features
141
+ ++++++++
142
+
143
+ - Update setuptools version pin.
144
+ (`#292 <https://github.com/zopefoundation/RestrictedPython/issues/292>`_)
145
+
146
+
127
147
  7.4 (2024-10-09)
128
148
  ----------------
129
149
 
@@ -20,30 +20,9 @@ docs/index.rst
20
20
  docs/logo.jpg
21
21
  docs/make.bat
22
22
  docs/requirements.txt
23
- docs/_build/doctest/output.txt
24
- docs/_build/html/_images/logo.jpg
25
- docs/_build/html/_sources/changes.rst.txt
26
- docs/_build/html/_sources/idea.rst.txt
27
- docs/_build/html/_sources/index.rst.txt
28
- docs/_build/html/_sources/contributing/changes_from310to311.rst.txt
29
- docs/_build/html/_sources/contributing/changes_from311to312.rst.txt
30
- docs/_build/html/_sources/contributing/changes_from312to313.rst.txt
31
- docs/_build/html/_sources/contributing/changes_from37to38.rst.txt
32
- docs/_build/html/_sources/contributing/changes_from38to39.rst.txt
33
- docs/_build/html/_sources/contributing/changes_from39to310.rst.txt
34
- docs/_build/html/_sources/contributing/index.rst.txt
35
- docs/_build/html/_sources/install/index.rst.txt
36
- docs/_build/html/_sources/roadmap/index.rst.txt
37
- docs/_build/html/_sources/usage/api.rst.txt
38
- docs/_build/html/_sources/usage/basic_usage.rst.txt
39
- docs/_build/html/_sources/usage/framework_usage.rst.txt
40
- docs/_build/html/_sources/usage/index.rst.txt
41
- docs/_build/html/_sources/usage/policy.rst.txt
42
- docs/_build/html/_static/scripts/furo.js.LICENSE.txt
43
23
  docs/contributing/changes_from310to311.rst
44
24
  docs/contributing/changes_from311to312.rst
45
25
  docs/contributing/changes_from312to313.rst
46
- docs/contributing/changes_from37to38.rst
47
26
  docs/contributing/changes_from38to39.rst
48
27
  docs/contributing/changes_from39to310.rst
49
28
  docs/contributing/index.rst
@@ -51,7 +30,6 @@ docs/contributing/ast/python3_10.ast
51
30
  docs/contributing/ast/python3_11.ast
52
31
  docs/contributing/ast/python3_12.ast
53
32
  docs/contributing/ast/python3_13.ast
54
- docs/contributing/ast/python3_7.ast
55
33
  docs/contributing/ast/python3_8.ast
56
34
  docs/contributing/ast/python3_9.ast
57
35
  docs/install/index.rst
@@ -68,19 +68,13 @@ def try_except_star(m):
68
68
  not IS_PY311_OR_GREATER,
69
69
  reason="ExceptionGroup class was added in Python 3.11.",
70
70
  )
71
- def test_RestrictingNodeTransformer__visit_TryStar__1(mocker):
72
- """It allows try-except* PEP 654 statements."""
73
- trace = mocker.stub()
74
- restricted_exec(TRY_EXCEPT_STAR)['try_except_star'](trace)
75
-
76
- trace.assert_has_calls([
77
- mocker.call('try'),
78
- mocker.call('IndentationError'),
79
- mocker.call('ValueError')
80
- ])
81
-
82
- with pytest.raises(AssertionError):
83
- trace.assert_has_calls([mocker.call('RuntimeError')])
71
+ def test_RestrictingNodeTransformer__visit_TryStar__1():
72
+ """It denies try-except* PEP 654 statements."""
73
+ result = compile_restricted_exec(TRY_EXCEPT_STAR)
74
+ assert result.errors == (
75
+ 'Line 3: TryStar statements are not allowed.',
76
+ )
77
+ assert result.code is None
84
78
 
85
79
 
86
80
  TRY_FINALLY = """
@@ -5,7 +5,6 @@ minversion = 3.18
5
5
  envlist =
6
6
  release-check
7
7
  lint
8
- py38
9
8
  py39
10
9
  py310
11
10
  py311
@@ -21,7 +20,7 @@ usedevelop = true
21
20
  package = wheel
22
21
  wheel_build_env = .pkg
23
22
  deps =
24
- setuptools <74
23
+ setuptools <= 75.6.0
25
24
  datetime: DateTime
26
25
  -cconstraints.txt
27
26
  pytest-cov
@@ -50,7 +49,7 @@ commands =
50
49
  coverage combine
51
50
  coverage html
52
51
  coverage report -m --fail-under=100
53
- depends = py38,py39,py310,py311,py311-datetime,py312,py313,coverage
52
+ depends = py39,py310,py311,py311-datetime,py312,py313,coverage
54
53
 
55
54
  [testenv:setuptools-latest]
56
55
  basepython = python3
@@ -65,7 +64,7 @@ description = ensure that the distribution is ready to release
65
64
  basepython = python3
66
65
  skip_install = true
67
66
  deps =
68
- setuptools <74
67
+ setuptools <= 75.6.0
69
68
  twine
70
69
  build
71
70
  check-manifest
@@ -1,35 +0,0 @@
1
- Results of doctest builder run on 2024-10-09 09:56:01
2
- =====================================================
3
-
4
- Document: usage/api
5
- -------------------
6
- 1 items passed all tests:
7
- 13 tests in default
8
- 13 tests in 1 items.
9
- 13 passed and 0 failed.
10
- Test passed.
11
-
12
- Document: usage/basic_usage
13
- ---------------------------
14
- 2 items passed all tests:
15
- 6 tests in default
16
- 1 tests in single
17
- 7 tests in 2 items.
18
- 7 passed and 0 failed.
19
- Test passed.
20
-
21
- Document: usage/framework_usage
22
- -------------------------------
23
- 2 items passed all tests:
24
- 1 tests in default
25
- 2 tests in own_policy
26
- 3 tests in 2 items.
27
- 3 passed and 0 failed.
28
- Test passed.
29
-
30
- Doctest summary
31
- ===============
32
- 23 tests
33
- 0 failures in tests
34
- 0 failures in setup code
35
- 0 failures in cleanup code
@@ -1 +0,0 @@
1
- .. include:: ../CHANGES.rst
@@ -1,5 +0,0 @@
1
- Changes from Python 3.10 to Python 3.11
2
- ---------------------------------------
3
-
4
- .. literalinclude:: ast/python3_11.ast
5
- :diff: ast/python3_10.ast
@@ -1,5 +0,0 @@
1
- Changes from Python 3.11 to Python 3.12
2
- ---------------------------------------
3
-
4
- .. literalinclude:: ast/python3_12.ast
5
- :diff: ast/python3_11.ast
@@ -1,5 +0,0 @@
1
- Changes from Python 3.12 to Python 3.13
2
- ---------------------------------------
3
-
4
- .. literalinclude:: ast/python3_13.ast
5
- :diff: ast/python3_12.ast
@@ -1,5 +0,0 @@
1
- Changes from Python 3.7 to Python 3.8
2
- -------------------------------------
3
-
4
- .. literalinclude:: ast/python3_8.ast
5
- :diff: ast/python3_7.ast
@@ -1,5 +0,0 @@
1
- Changes from Python 3.8 to Python 3.9
2
- -------------------------------------
3
-
4
- .. literalinclude:: ast/python3_9.ast
5
- :diff: ast/python3_8.ast
@@ -1,5 +0,0 @@
1
- Changes from Python 3.9 to Python 3.10
2
- --------------------------------------
3
-
4
- .. literalinclude:: ast/python3_10.ast
5
- :diff: ast/python3_9.ast