[Zope] [BUG] in OFS/Traversable.py

Jerome Alet alet@unice.fr
Sat, 12 May 2001 20:36:09 +0200


Hi,

there's a bug in OFS/Traversable.py

line 169 (on Zope 2.3.0 and 2.3.2) in unrestrictedTravese() there's:

--- CUT ---
if name[0] == '_':
    # Never allowed in a URL.
    raise 'NotFound', name
--- CUT ---

but when calling restrictedTraverse with only '/' as the path argument
the test above raises an IndexError, and it's possible that the rest 
of the function unrestrictedTraverse doesn't work correcly even when 
correcting this bug with a "if name and name[0]=='_'" (UNTESTED).

Example:

make a Python script, which has only the following line:

--- CUT ---
return repr(context.restrictedTraverse('/'))
--- CUT ---

Click on the Test tab, that's it !

Theorically and if I understand correctly what restrictedTraverse and 
unrestrictedTraverse are for, it should return the top level object
i.e. the root folder object or application object.

hoping this helps

Jerome Alet