Log message for revision 79680:
  - Collector #2352: fix in OFS.Traversable
  

Changed:
  U   Zope/branches/2.10/doc/CHANGES.txt
  U   Zope/branches/2.10/lib/python/OFS/Traversable.py
  U   Zope/branches/2.10/lib/python/OFS/tests/testTraverse.py

-=-
Modified: Zope/branches/2.10/doc/CHANGES.txt
===================================================================
--- Zope/branches/2.10/doc/CHANGES.txt  2007-09-15 16:45:50 UTC (rev 79679)
+++ Zope/branches/2.10/doc/CHANGES.txt  2007-09-15 16:51:06 UTC (rev 79680)
@@ -8,6 +8,8 @@
 
     Bugs fixed
 
+      - Collector #2352: fix in OFS.Traversable
+
       - Collector #2346: username logging in FCGI crashed the server
 
       - ZopePageTemplate's pt_edit did not recognize content type arguments

Modified: Zope/branches/2.10/lib/python/OFS/Traversable.py
===================================================================
--- Zope/branches/2.10/lib/python/OFS/Traversable.py    2007-09-15 16:45:50 UTC 
(rev 79679)
+++ Zope/branches/2.10/lib/python/OFS/Traversable.py    2007-09-15 16:51:06 UTC 
(rev 79680)
@@ -186,18 +186,18 @@
 
                 bobo_traverse = getattr(obj, '__bobo_traverse__', None)
                 try:
-                    if name and name[:1] in '@+' and name != '+':
+                    if name and name[:1] in '@+' and name != '+' and 
nsParse(name)[1]:
                         # Process URI segment parameters.
                         ns, nm = nsParse(name)
-                        if ns:
-                            try:
-                                next = namespaceLookup(
-                                    ns, nm, obj, self.REQUEST).__of__(obj)
-                                if restricted and not validate(
-                                    obj, obj, name, next):
-                                    raise Unauthorized(name)
-                            except TraversalError:
-                                raise AttributeError(name)
+                        try:
+                            next = namespaceLookup(
+                                ns, nm, obj, self.REQUEST).__of__(obj)
+                            if restricted and not validate(
+                                obj, obj, name, next):
+                                raise Unauthorized(name)
+                        except TraversalError:
+                            raise AttributeError(name)
+
                     elif bobo_traverse is not None:
                         next = bobo_traverse(REQUEST, name)
                         if restricted:

Modified: Zope/branches/2.10/lib/python/OFS/tests/testTraverse.py
===================================================================
--- Zope/branches/2.10/lib/python/OFS/tests/testTraverse.py     2007-09-15 
16:45:50 UTC (rev 79679)
+++ Zope/branches/2.10/lib/python/OFS/tests/testTraverse.py     2007-09-15 
16:51:06 UTC (rev 79680)
@@ -169,6 +169,7 @@
             self.app = makerequest( self.root, stdout=responseOut )
             manage_addFolder( self.app, 'folder1' )
             folder1 = getattr( self.app, 'folder1' )
+            setattr(folder1, '+something', 'plus')
 
             folder1.all_meta_types = \
                                     ( { 'name'        : 'File'
@@ -378,8 +379,12 @@
         self.failUnless(
             aq_base(self.root.folder1.file.restrictedTraverse('../..')) is
             aq_base(self.root))
+    
+    def testTraverseToNameStartingWithPlus(self):
+        # Verify it's possible to traverse to a name such as +something
+        self.failUnless(
+            self.folder1.unrestrictedTraverse('+something') is 'plus')
 
-
 import os, sys
 if __name__ == '__main__':
     execfile(os.path.join(sys.path[0], 'framework.py'))

_______________________________________________
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins

Reply via email to