pickle/marshal internal format 'life expectancy'/backward compatibility

Tim Peters tim.peters at gmail.com
Sat Feb 5 17:04:54 EST 2005


[Philippe C. Martin]
> I am looking into using the pickle format to store object/complex data
> structures into a smart card as it would make the design of the embedded
> application very simple.
>
> Yet the card might have to stay in the pocket of the customer for a few
> years, during which the back office application responsible for
> retrieving the information from the card might evolve as well as the
> python release it relies upon.
>
> Is there a commitment for python releases to be able to interpret
> 'older' pickle/marshal internal formats ?

Pickle and marshal have nothing in common, and there's no
cross-release guarantee about marshal behavior.  Pickles are safe in
this respect; indeed, each Python released to date has been able to
load pickles created by all earlier Python releases.  Of course a
pickle produced by a later Python may not be loadable by an earlier
Python, although even in that direction you can get cross-release
portability by forcing the newer Python to restrict itself to produce
obsolete pickle formats.  Reading Lib/pickletools.py in a current
release will explain all this.



More information about the Python-list mailing list