[IronPython] Compatibility of cPython Pickled Objects w/IronPython

nico rauhut nico.rauhut at web.de
Wed Sep 5 19:17:40 CEST 2007


I have run a few tests passing values from cPython to IronPython (and back)
using a pickled list (in order to integrate .NET-Components in Zope).
Unfortunately the results were not as good as expected.

The only protocol that seemed to be useful is version 0 of the
pickle-module. Using this protocol I was able to pass a list including some
floats, boolean and integer to IronPython, use these values in a .NET-class
and return the result-values to cPython. Only strings made some difficulties
(insecure string pickle).

Protocol-version 1 doesn't work properly. Especially float-values make some
trouble. When I unpickle my list in IronPython these values seemed to be
adulterated (...hmm don’t know if this is the right word :)

Protocol-version 2 seemed to be entire useless as I wasn’t able to unpickle
my list in cPython.

I tested the cPickle-module, too. But as expected the results were even
Are there any plans to improve the pickle-compatibility in future releases
of IronPython? Has somebody else made some other experiences with

Kindly regards,
Nico Rauhut

-----Ursprüngliche Nachricht-----
Von: users-bounces at lists.ironpython.com
[mailto:users-bounces at lists.ironpython.com] Im Auftrag von Michael Foord
Gesendet: Sonntag, 15. Juli 2007 20:33
An: Discussion of IronPython
Betreff: Re: [IronPython] Compatibility of cPython Pickled Objects

M. David Peterson wrote:
> As per the subject line, is there any reason why passing pickled 
> objects between cPython and IronPython wouldn't just work? Of course I 
> could just try and find out, but I hesitate to jump into unchartered 
> territory as (and I assume I am not alone in this) I have a tendency 
> to become infatuated with forcing things into submission when they 
> don't "just work", eating away an entire dev day or two in the process.
> Anyone care to help a brother save a couple dev days and a few strands 
> of hair? :D
> Thanks in advance!

I haven't tried it, but they *should* be compatible. Pickle uses its own 
stack based language to write out objects - so for pure Python it should 
work fine.

As pickle is a pure Python module which works (I'm pretty sure I tried 
it back in the past !?!) with IronPython, the semantics should be unchanged.

Michael Foord

> -- 
> /M:D
> M. David Peterson
> http://mdavid.name <http://mdavid.name> | 
> http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155
> ------------------------------------------------------------------------
> _______________________________________________
> users mailing list
> users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

users mailing list
users at lists.ironpython.com

More information about the Ironpython-users mailing list