RestrictedPython 7.0a2.dev0__py3-none-any.whl → 7.2__py3-none-any.whl

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.
@@ -246,6 +246,8 @@ def safer_getattr(object, name, default=None, getattr=getattr):
246
246
  http://lucumr.pocoo.org/2016/12/29/careful-with-str-format/
247
247
 
248
248
  """
249
+ if type(name) is not str:
250
+ raise TypeError('type(name) must be str')
249
251
  if name in ('format', 'format_map') and (
250
252
  isinstance(object, str) or
251
253
  (isinstance(object, type) and issubclass(object, str))):
@@ -593,6 +593,10 @@ class RestrictingNodeTransformer(ast.NodeTransformer):
593
593
  """
594
594
  return self.node_contents_visit(node)
595
595
 
596
+ def visit_Interactive(self, node):
597
+ """Allow single mode without restrictions."""
598
+ return self.node_contents_visit(node)
599
+
596
600
  def visit_List(self, node):
597
601
  """Allow list literals without restrictions."""
598
602
  return self.node_contents_visit(node)
@@ -768,8 +772,8 @@ class RestrictingNodeTransformer(ast.NodeTransformer):
768
772
  return self.node_contents_visit(node)
769
773
 
770
774
  def visit_MatMult(self, node):
771
- """Matrix multiplication (`@`) is currently not allowed."""
772
- self.not_allowed(node)
775
+ """Allow multiplication (`@`)."""
776
+ return self.node_contents_visit(node)
773
777
 
774
778
  def visit_BoolOp(self, node):
775
779
  """Allow bool operator without restrictions."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: RestrictedPython
3
- Version: 7.0a2.dev0
3
+ Version: 7.2
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.14
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: docs
@@ -123,8 +124,24 @@ the documentation `Contributing page
123
124
  Changes
124
125
  =======
125
126
 
126
- 7.0a2.dev0 (2023-11-06)
127
- -----------------------
127
+ 7.2 (2024-08-02)
128
+ ----------------
129
+
130
+ - Remove unneeded setuptools fossils that may cause installation problems
131
+ with recent setuptools versions.
132
+ - Add support for single mode statements / execution.
133
+ - Fix a potential breakout capability in the provided ``safer_getattr`` method
134
+ that is part of the ``safer_builtins``.
135
+
136
+
137
+ 7.1 (2024-03-14)
138
+ ----------------
139
+
140
+ - Add support for the matmul (``@``) operator.
141
+
142
+
143
+ 7.0 (2023-11-17)
144
+ ----------------
128
145
 
129
146
  Backwards incompatible changes
130
147
  ++++++++++++++++++++++++++++++
@@ -134,8 +151,7 @@ Backwards incompatible changes
134
151
  Features
135
152
  ++++++++
136
153
 
137
- - Allow to use the package with Python 3.12 and 3.13 -- Caution: No security
138
- audit has been done so far.
154
+ - Officially support Python 3.12.
139
155
 
140
156
  Fixes
141
157
  +++++
@@ -145,8 +161,7 @@ Fixes
145
161
  - Forbid using some attributes providing access to restricted Python internals.
146
162
  (CVE-2023-37271)
147
163
 
148
- - Fix information disclosure problems through
149
- Python's "format" functionality
164
+ - Fix information disclosure problems through Python's "format" functionality
150
165
  (``format`` and ``format_map`` methods on ``str`` and its instances,
151
166
  ``string.Formatter``). (CVE-2023-41039)
152
167
 
@@ -0,0 +1,14 @@
1
+ RestrictedPython/Eval.py,sha256=pa79tc-JsT7xfzwg0ceMkxyioIEnFbNHc_PsKUhkkj8,3201
2
+ RestrictedPython/Guards.py,sha256=61wKg3bAFmGCyjJMAb5fE7l0He2xOpF5HTM61gSAwW4,7726
3
+ RestrictedPython/Limits.py,sha256=dORpuly21vSjy8gzNac9IYfIXMMWRVFvqUiKKIeZ3OM,1866
4
+ RestrictedPython/PrintCollector.py,sha256=bBCpnUPOuKz1wJDuSgh7wo2aoKfcTJeeT8OYnM-K9F8,1137
5
+ RestrictedPython/Utilities.py,sha256=7R6Op1Oqw9-fSxy_eWVa6ioZPx-SAxa7OolDObTWRkU,2937
6
+ RestrictedPython/__init__.py,sha256=qB_s6zDxuXPAGMoKYKBMc-xZ0gTnQ0ZvtY5FxdAG3aM,1862
7
+ RestrictedPython/_compat.py,sha256=nacdAJi4E8GKhkR99_BAxMA0AtK2FQnvrqZbG8hGofc,383
8
+ RestrictedPython/compile.py,sha256=IhcF733t-bkPcvfQ2_NyBeCbSIPtHYxR-GQNNHnaMHM,6727
9
+ RestrictedPython/transformer.py,sha256=toPGqFvc9WM1bnh2yIgNZcsz0ySwlSyJXViCSau-19I,42906
10
+ RestrictedPython-7.2.dist-info/LICENSE.txt,sha256=PmcdsR32h1FswdtbPWXkqjg-rKPCDOo_r1Og9zNdCjw,2070
11
+ RestrictedPython-7.2.dist-info/METADATA,sha256=ZfRIK0nc484O0Aiw-HU1jDySSl3FTZR81a67R9yz1sc,12562
12
+ RestrictedPython-7.2.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
13
+ RestrictedPython-7.2.dist-info/top_level.txt,sha256=E1-3ARWcduVJnQAScms0FgqnBx_PovrzYsNMYuLGwa0,17
14
+ RestrictedPython-7.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.41.2)
2
+ Generator: bdist_wheel (0.42.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,14 +0,0 @@
1
- RestrictedPython/Eval.py,sha256=pa79tc-JsT7xfzwg0ceMkxyioIEnFbNHc_PsKUhkkj8,3201
2
- RestrictedPython/Guards.py,sha256=XXupE0TwcWdb6qAsSexWUYEIeT3bVLTdOVvn94eoqs0,7646
3
- RestrictedPython/Limits.py,sha256=dORpuly21vSjy8gzNac9IYfIXMMWRVFvqUiKKIeZ3OM,1866
4
- RestrictedPython/PrintCollector.py,sha256=bBCpnUPOuKz1wJDuSgh7wo2aoKfcTJeeT8OYnM-K9F8,1137
5
- RestrictedPython/Utilities.py,sha256=7R6Op1Oqw9-fSxy_eWVa6ioZPx-SAxa7OolDObTWRkU,2937
6
- RestrictedPython/__init__.py,sha256=qB_s6zDxuXPAGMoKYKBMc-xZ0gTnQ0ZvtY5FxdAG3aM,1862
7
- RestrictedPython/_compat.py,sha256=nacdAJi4E8GKhkR99_BAxMA0AtK2FQnvrqZbG8hGofc,383
8
- RestrictedPython/compile.py,sha256=IhcF733t-bkPcvfQ2_NyBeCbSIPtHYxR-GQNNHnaMHM,6727
9
- RestrictedPython/transformer.py,sha256=r1J-3qnS2sOHcbSR15-PBQSh5w3Wf1uzoLb_XmGSYUM,42777
10
- RestrictedPython-7.0a2.dev0.dist-info/LICENSE.txt,sha256=PmcdsR32h1FswdtbPWXkqjg-rKPCDOo_r1Og9zNdCjw,2070
11
- RestrictedPython-7.0a2.dev0.dist-info/METADATA,sha256=mCQblZFkRYYAwcIeA9RPDsgdyhLAm6aSwqc7qH7-8Vw,12202
12
- RestrictedPython-7.0a2.dev0.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
13
- RestrictedPython-7.0a2.dev0.dist-info/top_level.txt,sha256=E1-3ARWcduVJnQAScms0FgqnBx_PovrzYsNMYuLGwa0,17
14
- RestrictedPython-7.0a2.dev0.dist-info/RECORD,,