[IronPython] Compatibility of cPython Pickled Objects w/IronPython

Dino Viehland dinov at exchange.microsoft.com
Wed Sep 5 22:32:24 CEST 2007


I don't believe we are aware of these issues - there are a couple of bugs open against pickling but they seem to be around types we apparently don't support (xrange, re) and features we don't support in cPickle (persistent load support) and .NET interop (System.DateTime).

Is there anything other than floats w/ protocol 1?  Are the lists all the same in each version?  W/ a little more detail we can open a bug and look at getting the issues fixed.

-----Original Message-----
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of nico rauhut
Sent: Wednesday, September 05, 2007 10:18 AM
To: 'Discussion of IronPython'
Subject: Re: [IronPython] Compatibility of cPython Pickled Objects w/IronPython

Hello,

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
worse.

Are there any plans to improve the pickle-compatibility in future releases
of IronPython? Has somebody else made some other experiences with
Pickle/cPickle?


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
w/IronPython

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
http://www.voidspace.org.uk/ironpython/index.shtml

>
> --
> /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
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

_______________________________________________
Users mailing list
Users at lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com



More information about the Ironpython-users mailing list