Re: Custom Class Serialization with Serpent.

Irmen de Jong <[email protected]> Tue, 17 Dec 2013 23:53:26 +0100
Newsgroups gmane.comp.python.pyro
Message-ID <[email protected]>
On 17-12-2013 4:34, Abhishek Dwaraki wrote:
> Hey Irmen, I agree that the problem lies with the deserialization. But should the
> same behavior happen when I am not using IPAddress? Rather, I am using a custom class
> composed of primitives, if you may call them that. I see the deserialization error
> even on a class that contains just integers and strings.

Well yes, this is currently by design. It is this way due to security considerations.
You can see what the limited set of classes is that Pyro reconstructs when deserializing
some serpent data, by inspecting the dict_to_class method.
See https://github.com/irmen/Pyro4/blob/master/src/Pyro4/util.py#L241

The enhancement I mentioned earlier is to add some mechanism to this that will allow you
to add your own special classes to this. For now, you'll have to stick with the fact
that most classes are simply serialized as a dict when using serpent.


Irmen

------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk