[Zope-CMF] Is it a typo error in CMFCore/PortalFolder.py?

Tres Seaver tseaver@zope.com
02 Jun 2002 14:25:27 -0400


On Sun, 2002-06-02 at 06:20, joeysj@ms3.hinet.net wrote:
> 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:
> 

You are correct;  the code here is a fossil from a time before the
Unauthorized object existed.  Please report this as a tracker issue:

  http://www.zope.org/Products/PTK/Tracker

Tres.
-- 
===============================================================
Tres Seaver                                tseaver@zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com