Voodoo with ModuleSecurityInfo, was Re: [Zope] importing encode_base64

Paul Winkler pw_lists at slinkp.com
Thu Jun 9 15:42:36 EDT 2005


On Thu, Jun 09, 2005 at 08:18:30PM +0200, Dieter Maurer wrote:
> Paul Winkler wrote at 2005-6-8 20:48 -0400:
> > ...
> >from Products.FooProduct import Utils
> >return Utils.foo(context)
> >
> >
> >And in Products/FooProduct/__init__.py, I had this:
> >
> >ModuleSecurityInfo('Products.FooProduct').declarePublic(
> >    'blah', 'foo')
> 
> This allows something like:
> 
>      from Products.FooProduct import foo
> 
> But, in fact, you use
> 
>      from Products.FooProduct import Utils
>      ... Utils.foo ...
> 
> Strange, that it worked at all...

Yeah, I think I just happened to hit on some undocumented
behavior that *mostly* works.

The moral of the story, of course, is "don't do that"!

-- 

Paul Winkler
http://www.slinkp.com


More information about the Zope mailing list