[Twisted-Python] Problems with PB and Jelly...

Jasper Phillips jasper at peak.org
Thu Mar 20 18:54:39 EST 2003

Hash: SHA1

On Thu, 20 Mar 2003, Jasper Phillips wrote:
> On Wed, 19 Mar 2003, Sean Riley wrote:
> Thanks for your response!
> > The "Module not allowed" exception means that you need to call
> > setCopierForClass for the class. This maps a server-side class string to a
> > client side class so the Jelly knows what type of object to create on the
> > client.  For example:
> >
> > pb.setCopierForClass('MyApp.game.server.door.Door', RemoteDoor)
> >
> > This is usually done at the bottom of the file that the class client-side is
> > defined in.
> I thought this was what pb.SetUnjellableForClass() was for...  Inspecting
> pb.py leads to flavors.py, where I see that setCopierForClass is actually a
> reference to setUnjellyableForClass.  So I'm already doing this -- note that
> I'm not getting class not allowed exceptions, but module not allowed.
> Moreover following the logic through to it's culmination in
> jelly.SecurityOptions.allowTypes(), I still can't see how this could affect
> which modules are allowed.
> It looks like I need to call jelly.globalSecurity.allowInstancesOf()
> directly.  Probably in a similar manner to how jelly.SetUnjellyableForClass()
> calls globalSecuirty.allowTypes().  Actually, this looks like a bug:
> shouldn't SetUnjellyableForClass() call allowInstancesOf() rather than
> allowTypes()?

I see my error now!  I was missing a call to SetUnjellyableForClass() (I
should use SetUnjellyableForClassTree() ).

The "module not allowed" exception is misleading, and stems from what appears
to be an obsolete branch "else" branch of jelly._Unjellier.unjelly(), judging
by the fact that it uses the temp variable jelType for something different
than the "if" branch.

Sorry for all the fuss. :-(
- -Jasper

Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org


More information about the Twisted-Python mailing list