[Zope] The "' 'in ' requires character as left operand" bug (was: Problem with Security tab, at the root)

Ausum Studio ausum_studio@hotmail.com
Sat, 14 Sep 2002 04:28:21 -0500


I found the problem, and it was due to a bug in the MyMediaManager product
1.1.1 which I installed for testing purposes a while ago.
The problem consists in that the role Manager for the CreditTool Module
isn't declared as a single element tuple, but as a string.

So these are the required changes in CreditTool.py,  starting at line 109:

        #_dtmldir = os.path.join( package_home( globals() ), 'dtml' )

        ManagePayments = 'Register and clear payments'
-       setDefaultRoles(ManagePayments, ('Manager'))
+       setDefaultRoles(ManagePayments, ('Manager',))

        ManageTransactions = 'Clear and register usage'
-       setDefaultRoles(ManageTransactions, ('Manager'))
+       setDefaultRoles(ManageTransactions, ('Manager',))

        class PaymentTool (UniqueObject, Folder):

As you may notice, the traceback doesn't tell about the offending code,
because it comes from an iteration within the "permission_settings" function
at the Role.py module. If you ever have this problem, I suggest you to
manually trace the type of variable "role" and the key "name", in that
module.



Ausum




----- Original Message -----
From: "Ausum Studio" <ausum_studio@hotmail.com>
To: <zope@zope.org>
Sent: Friday, September 13, 2002 2:50 PM
Subject: [Zope] Problem with Security tab, at the root


> This is the second time it happens, though I didn't have the time to
> replicate sucessfully what drove me there (cause I was ready to upgrade to
> 251 at that moment). This is what appears when I want to enter the
security
> tab, at Zope's root:
>
> 'in ' requires character as left operand
>
> (zope logo)
> Traceback (innermost last):
>   File D:\ARCHIV~1\Zope251\lib\python\ZPublisher\Publish.py, line 150, in
> publish_module
>   File D:\ARCHIV~1\Zope251\lib\python\ZPublisher\Publish.py, line 114, in
> publish
>   File D:\ARCHIV~1\Zope251\lib\python\Zope\__init__.py, line 159, in
> zpublisher_exception_hook
>     (Object: Zope)
>   File D:\ARCHIV~1\Zope251\lib\python\ZPublisher\Publish.py, line 98, in
> publish
>   File D:\ARCHIV~1\Zope251\lib\python\ZPublisher\mapply.py, line 88, in
> mapply
>     (Object: manage_access)
>   File D:\ARCHIV~1\Zope251\lib\python\ZPublisher\Publish.py, line 39, in
> call_object
>     (Object: manage_access)
>   File D:\ARCHIV~1\Zope251\lib\python\AccessControl\Role.py, line 186, in
> manage_access
>     (Object: Zope)
>   File D:\ARCHIV~1\Zope251\lib\python\Shared\DC\Scripts\Bindings.py, line
> 252, in __call__
>     (Object: _normal_manage_access)
>   File D:\ARCHIV~1\Zope251\lib\python\Shared\DC\Scripts\Bindings.py, line
> 283, in _bindAndExec
>     (Object: _normal_manage_access)
>   File D:\ARCHIV~1\Zope251\lib\python\App\special_dtml.py, line 172, in
> _exec
>     (Object: _normal_manage_access)
>   File D:\ARCHIV~1\Zope251\lib\python\DocumentTemplate\DT_With.py, line
76,
> in render
>     (Object: _.namespace(valid_roles=valid_roles()))
>   File D:\ARCHIV~1\Zope251\lib\python\DocumentTemplate\DT_In.py, line 617,
> in renderwob
>     (Object: permission_settings)
>   File D:\ARCHIV~1\Zope251\lib\python\AccessControl\Role.py, line 111, in
> permission_settings
>     (Object: Zope)
>   File D:\ARCHIV~1\Zope251\lib\python\AccessControl\Role.py, line 106, in
> <lambda>
> TypeError: (see above)
>
> All the other tabs work, including the same 'Security' tabs within each
> folder. The only place when this error happens is at the root.
> I'm not sure at what moment the problem could've happened, because I
didn't
> need to look at that tab for quite a time. Has anyone else had this
> experience?
>
> Ausum
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
>