Commit e8151d9c authored by Hanno Schlichting's avatar Hanno Schlichting

Really revert all experimental changes to OFS.Traversable

parent ecd32892
...@@ -146,25 +146,26 @@ class Traversable: ...@@ -146,25 +146,26 @@ class Traversable:
if not path: if not path:
return self return self
if type(path) is str: if isinstance(path, str):
# Unicode paths are not allowed # Unicode paths are not allowed
path = path.split('/') path = path.split('/')
else: else:
path = list(path) path = list(path)
REQUEST = {'TraversalRequestNameStack': path} REQUEST = {'TraversalRequestNameStack': path}
path.reverse()
path_pop = path.pop path_pop = path.pop
if not path[-1]: if len(path) > 1 and not path[0]:
# Remove trailing slash # Remove trailing slash
path_pop() path_pop(0)
if restricted: if restricted:
validate = getSecurityManager().validate 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. # If the path starts with an empty string, go to the root first.
path_pop(0) path_pop()
obj = self.getPhysicalRoot() obj = self.getPhysicalRoot()
if restricted: if restricted:
validate(None, None, None, obj) # may raise Unauthorized validate(None, None, None, obj) # may raise Unauthorized
...@@ -173,7 +174,8 @@ class Traversable: ...@@ -173,7 +174,8 @@ class Traversable:
resource = _marker resource = _marker
try: try:
for name in path: while path:
name = path_pop()
__traceback_info__ = path, name __traceback_info__ = path, name
if name[0] == '_': if name[0] == '_':
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment