[Python-Dev] Pickle format machine independence

Hrvoje Nikšić hrvoje.niksic at avl.com
Mon Apr 14 15:56:47 CEST 2008

Are pickle files intended to be readable across different machine
architectures?  The documentation states unequivocally that they are
compatible across Python versions, but compatibility across machine
architectures (wrt to differences in size and layout of primitive C
types) is not explicitly addressed.

One example where I stumbled upon the incompatibility is the pickling of
arrays.  While pickle is normally very careful to write out numbers in a
platform-independent way, arrays are written out in "tostring" format.
This is filed under http://bugs.python.org/issue2389.

I can work around this issue in my application, but if this is
considered a bug, I'd prefer to fix it in Python instead.

More information about the Python-Dev mailing list