validate() trouble in Zope-2.5.0a1
I don't know if I'm doing something wrong, but when I try to unpack and run Zope-2.5.0a1 I can't seem to authenticate manage_workspace. I haven't snooped much, but it seems that "options" in Management.py comes back empty:
/usr/local/etc/Zope2d/lib/python/App/Management.py(147)manage_workspace() -> try: (Pdb) print options [] (Pdb) l 142 """ 143 import pdb 144 pdb.set_trace() 145 146 options=self.filtered_manage_options(REQUEST) 147 -> try: 148 m=options[0]['action'] 149 if m=='manage_workspace': raise TypeError 150 except: 151 raise Unauthorized, ( 152 'You are not authorized to view this object.') When I look into self.filtered_manage_options(REQUEST) it seems that "getSecurityManager.validate" always throws an exception "this function takes no keyword arguments"
/usr/local/etc/Zope2d/lib/python/App/Management.py(130)filtered_manage_options( ) -> if validate(container=self, value=o): (Pdb) n TypeError: 'this functio...ord arguments'
/usr/local/etc/Zope2d/lib/python/App/Management.py(130)filtered_manage_options( ) -> if validate(container=self, value=o): (Pdb) n
/usr/local/etc/Zope2d/lib/python/App/Management.py(132)filtered_manage_options( ) -> except: (Pdb) l 127 if o is None: continue 128 129 try: 130 if validate(container=self, value=o): 131 result.append(d) 132 -> except: 133 if not hasattr(o, '__roles__'): 134 result.append(d) 135 136 return result (Pdb) print __exception__ (<class exceptions.TypeError at 0x80ec60c>, 'this function takes no keyword arguments') (Pdb) Anyway.. no more time to play now.. any idea what's up? thanks, -steve
steve, unfortunately 2.5.0a1 had some serious issues.... alpha2 should come out really soon and fix them. in a nutshell, alpha1 is unusable. you can stop playing ;) jens On Sunday, October 28, 2001, at 04:20 , Steve Spicklemire wrote:
I don't know if I'm doing something wrong, but when I try to unpack and run Zope-2.5.0a1 I can't seem to authenticate manage_workspace. I haven't snooped much, but it seems that "options" in Management.py comes back empty:
/usr/local/etc/Zope2d/lib/python/App/Management.py(147)manage_workspace( ) -> try: (Pdb) print options [] (Pdb) l 142 """ 143 import pdb 144 pdb.set_trace() 145 146 options=self.filtered_manage_options(REQUEST) 147 -> try: 148 m=options[0]['action'] 149 if m=='manage_workspace': raise TypeError 150 except: 151 raise Unauthorized, ( 152 'You are not authorized to view this object.')
When I look into
self.filtered_manage_options(REQUEST)
it seems that "getSecurityManager.validate" always throws an exception "this function takes no keyword arguments"
/usr/local/etc/Zope2d/lib/python/App/Management.py(130)filtered_manage_options( ) -> if validate(container=self, value=o): (Pdb) n TypeError: 'this functio...ord arguments'
/usr/local/etc/Zope2d/lib/python/App/Management.py(130)filtered_manage_options( ) -> if validate(container=self, value=o): (Pdb) n
/usr/local/etc/Zope2d/lib/python/App/Management.py(132)filtered_manage_options( ) -> except: (Pdb) l 127 if o is None: continue 128 129 try: 130 if validate(container=self, value=o): 131 result.append(d) 132 -> except: 133 if not hasattr(o, '__roles__'): 134 result.append(d) 135 136 return result
(Pdb) print __exception__ (<class exceptions.TypeError at 0x80ec60c>, 'this function takes no keyword arguments') (Pdb)
Anyway.. no more time to play now.. any idea what's up?
thanks, -steve
_______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Jens Vagelpohl wrote:
steve,
unfortunately 2.5.0a1 had some serious issues.... alpha2 should come out really soon and fix them. in a nutshell, alpha1 is unusable. you can stop playing ;)
jens
On Sunday, October 28, 2001, at 04:20 , Steve Spicklemire wrote:
[...] ) -> if validate(container=self, value=o): (Pdb) n [...]
Yup, this was my bad -- that line should be changed to read if validate(None, self, None, o, None): since the C machinery isn't taking keyword arguments. Its in the 2.5.0a2 announcment. In some regards, it baffles me that it worked in the first place, because the first 4 or 5 arguments to validate are NOT optional, and have no default. I suspect that someone along the way was plugging in None for those options that weren't specified. But I'm ignorant on the exact details of Python argument marshalling... The particular code in SecurityManager.py has a validate() method which does supply None as defaults, but then passes them as positional parameters to the underlying implementation. So, I think the DTML security manager is accelerating this by skipping what basically is an empty wrapper stage (promoting the policy's validate() method into the object), and thats what is tripping the bug. Alternatively, the setting the environment variable ZOPE_SECURITY_POLICY to PYTHON will disable the C version of the security policy.
participants (3)
-
Jens Vagelpohl -
Matthew T. Kromer -
Steve Spicklemire