[Twisted-Python] Problem passing objects with perspective broker

Fourat ZOUARI fourat at gmail.com
Sun Jan 29 00:57:17 EST 2012


Hi,

Whenever i try to pass an object (aClass) with a property with a second
object (bClass) Am getting:

*Unpersistable('Unpersistable data: instance of class amodule.bClass deemed
insecure')*


The aClass is copyable and unjellied, the bClass is not.

Here's my code:

server.py:

from twisted.application import internet, service
from twisted.spread import pb
from amodule import PBServer

application = service.Application("Test app")

# Prepare managers
clientManager = internet.TCPServer(8282, pb.PBServerFactory(PBServer()));
clientManager.setServiceParent(application)

if __name__ == '__main__':
    print "Run with twistd"
    import sys
    sys.exit(1)


amodule.py:

from twisted.spread import pb

class bClass:
    """This is not a Copyable class
    """

class aClass(pb.RemoteCopy, pb.Copyable):
    b = bClass()
pb.setUnjellyableForClass(aClass, aClass)

class PBServer(pb.Root):
    def remote_echo(self, a):
        return a.b

Is there anyway to unjelly aClass and all the objects it can contain ?
because unjellying included object is a headache and may turn into dirty
code ...

Regards, Fourat
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20120129/61fa7a74/attachment.htm 


More information about the Twisted-Python mailing list