SVN: Zope/branches/2.13/src/OFS/Traversable.py Really revert all experimental changes to OFS.Traversable

Hanno Schlichting <[email protected]>
Newsgroups gmane.comp.web.zope.cvs
Message-ID <[email protected]>
Log message for revision 122635:
  Really revert all experimental changes to OFS.Traversable
  

Changed:
  U   Zope/branches/2.13/src/OFS/Traversable.py

-=-
Modified: Zope/branches/2.13/src/OFS/Traversable.py
===================================================================
--- Zope/branches/2.13/src/OFS/Traversable.py	2011-08-20 16:21:56 UTC (rev 122634)
+++ Zope/branches/2.13/src/OFS/Traversable.py	2011-08-20 16:26:13 UTC (rev 122635)
@@ -146,25 +146,26 @@
         if not path:
             return self
 
-        if type(path) is str:
+        if isinstance(path, str):
             # Unicode paths are not allowed
             path = path.split('/')
         else:
             path = list(path)
 
         REQUEST = {'TraversalRequestNameStack': path}
+        path.reverse()
         path_pop = path.pop
 
-        if not path[-1]:
+        if len(path) > 1 and not path[0]:
             # Remove trailing slash
-            path_pop()
+            path_pop(0)
 
         if restricted:
             validate = getSecurityManager().validate
 
-        if path and not path[0]:
+        if not path[-1]:
             # If the path starts with an empty string, go to the root first.
-            path_pop(0)
+            path_pop()
             obj = self.getPhysicalRoot()
             if restricted:
                 validate(None, None, None, obj) # may raise Unauthorized
@@ -173,7 +174,8 @@
 
         resource = _marker
         try:
-            for name in path:
+            while path:
+                name = path_pop()
                 __traceback_info__ = path, name
 
                 if name[0] == '_':

_______________________________________________
Zope-Checkins maillist  -  [email protected]
https://mail.zope.org/mailman/listinfo/zope-checkins
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.