[Zope3-checkins] SVN: Zope3/trunk/ Fixed issue 564, http://www.zope.org/Collectors/Zope3-dev/564

Jim Fulton jim at zope.com
Sun Jul 16 13:14:42 EDT 2006


Log message for revision 69149:
  Fixed issue 564, http://www.zope.org/Collectors/Zope3-dev/564
  
  Binary set operations (&, |, ^, -) weren't avaliable for proxied sets.
  
  Also added tests for set checkers.
  

Changed:
  U   Zope3/trunk/doc/CHANGES.txt
  U   Zope3/trunk/src/zope/security/checker.py
  A   Zope3/trunk/src/zope/security/tests/test_set_checkers.py

-=-
Modified: Zope3/trunk/doc/CHANGES.txt
===================================================================
--- Zope3/trunk/doc/CHANGES.txt	2006-07-16 17:10:19 UTC (rev 69148)
+++ Zope3/trunk/doc/CHANGES.txt	2006-07-16 17:14:41 UTC (rev 69149)
@@ -16,6 +16,8 @@
 
     Bug fixes
 
+      - Fixed issue 564: binary set operations didn't work on proxied sets.
+
       - Fixed issue 572: Dict fields with key_type or value_type set
         didn't handle binding correctly.
       

Modified: Zope3/trunk/src/zope/security/checker.py
===================================================================
--- Zope3/trunk/src/zope/security/checker.py	2006-07-16 17:10:19 UTC (rev 69148)
+++ Zope3/trunk/src/zope/security/checker.py	2006-07-16 17:14:41 UTC (rev 69149)
@@ -578,6 +578,7 @@
                             'copy', 'difference', 'intersection', 'issubset',
                             'issuperset', 'symmetric_difference', 'union',
                             '__and__', '__or__', '__sub__', '__xor__',
+                            '__rand__', '__ror__', '__rsub__', '__rxor__',
                             '__eq__', '__ne__', '__lt__', '__gt__',
                             '__le__', '__ge__'])
 
@@ -664,6 +665,8 @@
                         '__add__', '__radd__', ]),
     sets.Set: _setChecker,
     sets.ImmutableSet: _setChecker,
+    set: _setChecker,
+    frozenset: _setChecker,
 
     # YAGNI: () a rock
     tuple: NamesChecker(['__getitem__', '__getslice__', '__add__', '__radd__',
@@ -704,14 +707,6 @@
     zope.interface.declarations.Declaration: _Declaration_checker,
 }
 
-# If we are running with Python 2.4+, setup security on the builtin
-# set and frozenset types.
-try:
-    _default_checkers[set] = _setChecker
-    _default_checkers[frozenset] = _setChecker
-except NameError:
-    pass
-
 def _clear():
     _checkers.clear()
     _checkers.update(_default_checkers)

Copied: Zope3/trunk/src/zope/security/tests/test_set_checkers.py (from rev 69148, Zope3/branches/3.3/src/zope/security/tests/test_set_checkers.py)



More information about the Zope3-Checkins mailing list