[Zope-CMF] Is it a typo error in CMFCore/PortalFolder.py?
joeysj@ms3.hinet.net
joeysj@ms3.hinet.net
Sun, 2 Jun 2002 18:20:00 +0800 (CST)
This is a multi-part message in MIME format...
------------=_1023013200-139-0
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
Hi all,
When I checked source code of the function 'listFolderContents' in
CMFCore/PortalFolder.py, I found that there seems to be a typo error
in the section of try-except statements which is quoted as below::
try:
if getSecurityManager().validate(self, self, id, v):
l.append(obj)
except "Unauthorized":
pass
The exception that will be raised by 'getSecurityManager().validate'
is a class 'AccessControl.Unauthorized' instead of a string "Unauthorized".
So, the clause
except "Unauthorized":
should be
except Unauthorized:
If I am right, the file 'CMFCore/PortalFolder.py' should
be patched as below::
31c31
< from AccessControl import getSecurityManager, ClassSecurityInfo
---
> from AccessControl import getSecurityManager, ClassSecurityInfo, Unauthorized
223c223
< except "Unauthorized":
---
> except Unauthorized:
---
Joe Y.S. Jaw
------------=_1023013200-139-0--