Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
5
Merge Requests
5
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
slapos
Commits
aa8af02d
Commit
aa8af02d
authored
Mar 08, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixup! fixup! fixup! fixup! fixup! fixup! ERP5 py3: WIP ( all changes squashed )
parent
778074eb
Pipeline
#33331
failed with stage
in 0 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
10 deletions
+16
-10
component/egg-patch/AccessControl/147.patch
component/egg-patch/AccessControl/147.patch
+15
-9
stack/erp5/buildout.cfg
stack/erp5/buildout.cfg
+1
-1
No files found.
component/egg-patch/AccessControl/147.patch
View file @
aa8af02d
From
cd7e5680a120b3191966657723feae7d5c6bf348
Mon Sep 17 00:00:00 2001
From
3666a7afd46ea6d069606450c520b8b7e2b5fddf
Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Thu, 22 Feb 2024 23:33:41 +0900
Subject: [PATCH] Make dict views behave like their unrestricted versions
...
...
@@ -13,10 +13,10 @@ During this refactoring, also change `.items()` to validate
ach keys and values, like `.keys()` and `.values()` do.
---
CHANGES.rst | 7 ++++
src/AccessControl/ZopeGuards.py |
48 +++++++++++++++++-
-----
src/AccessControl/tests/actual_python.py |
29
++++++++++++++
src/AccessControl/tests/testZopeGuards.py | 34 +++++++++++----
-
4 files changed,
98
insertions(+), 20 deletions(-)
src/AccessControl/ZopeGuards.py |
50 ++++++++++++++++++
-----
src/AccessControl/tests/actual_python.py |
33 +
++++++++++++++
src/AccessControl/tests/testZopeGuards.py | 34 +++++++++++----
4 files changed,
104
insertions(+), 20 deletions(-)
diff --git a/CHANGES.rst b/CHANGES.rst
index f35a8d2..073b791 100644
...
...
@@ -37,7 +37,7 @@ index f35a8d2..073b791 100644
6.3 (2023-11-20)
----------------
diff --git a/src/AccessControl/ZopeGuards.py b/src/AccessControl/ZopeGuards.py
index 84c2e9e..
c89068a
100644
index 84c2e9e..
bc24941
100644
--- a/src/AccessControl/ZopeGuards.py
+++ b/src/AccessControl/ZopeGuards.py
@@ -12,6 +12,7 @@
...
...
@@ -94,11 +94,13 @@ index 84c2e9e..c89068a 100644
def _check_dict_access(name, value):
# Check whether value is a dict method
@@ -262,6 +265,
29
@@
def __next__(self):
@@ -262,6 +265,
31
@@
def __next__(self):
next = __next__
+class _SafeMappingView:
+ __allow_access_to_unprotected_subobjects__ = 1
+
+ def __iter__(self):
+ for e in super().__iter__():
+ guard(self._mapping, e)
...
...
@@ -125,10 +127,10 @@ index 84c2e9e..c89068a 100644
def __init__(self, ob):
self._iter = ob
diff --git a/src/AccessControl/tests/actual_python.py b/src/AccessControl/tests/actual_python.py
index 3405b8e..
337275d
100644
index 3405b8e..
866a480
100644
--- a/src/AccessControl/tests/actual_python.py
+++ b/src/AccessControl/tests/actual_python.py
@@ -123,6 +123,3
5
@@
def f7():
@@ -123,6 +123,3
9
@@
def f7():
access = getattr(d, meth)
result = sorted(access())
assert result == expected[kind], (meth, kind, result, expected[kind])
...
...
@@ -136,6 +138,10 @@ index 3405b8e..337275d 100644
+ iter_ = access() # iterate twice on the same view
+ assert list(iter_) == list(iter_)
+
+ assert sorted([k for k in getattr(d, meth)()]) == expected[kind]
+ assert sorted(k for k in getattr(d, meth)()) == expected[kind]
+ assert {k: v for k, v in d.items()} == d
+
+ assert 1 in d
+ assert 1 in d.keys()
+ assert 2 in d.values()
...
...
stack/erp5/buildout.cfg
View file @
aa8af02d
...
...
@@ -716,7 +716,7 @@ Zope-patches =
Zope-patch-options = -p1
[eggs:python3]
AccessControl-patches = ${:_profile_base_location_}/../../component/egg-patch/AccessControl/147.patch#5
4f19d3b58850f7dc58b16884425d8bb
AccessControl-patches = ${:_profile_base_location_}/../../component/egg-patch/AccessControl/147.patch#5
eb2b07dc79bef05dbc0c60d046d2847
AccessControl-patch-options = -p1
interval-patches = ${:_profile_base_location_}/../../component/egg-patch/interval/0001-python3-support.patch#66ac345f0a6d73e0bd29e394b7646311
interval-patch-options = -p1
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment