[Python-bugs-list] [ python-Bugs-650739 ] Binary pickle format depends on marshal

noreply@sourceforge.net noreply@sourceforge.net
Mon, 09 Dec 2002 08:53:23 -0800


Bugs item #650739, was opened at 2002-12-09 03:22
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=650739&group_id=5470

Category: Python Library
>Group: Not a Bug
>Status: Closed
>Resolution: Invalid
Priority: 5
Submitted By: L. Peter Deutsch (lpd)
>Assigned to: Tim Peters (tim_one)
Summary: Binary pickle format depends on marshal

Initial Comment:
The documentation of the pickle package (section
3.14.1) says "The pickle serialization format is
guaranteed to be backwards compatible across Python
releases."  While this is easy to verify for the
non-binary format, the binary format calls
marshal.dumps and marshal.loads in quite a few places,
and is thus subject to the statement in the same
paragraph that "The marshal serialization format is not
guaranteed to be portable across Python versions."

It appears that mdumps and mloads are only used for
converting integers to and from binary format. I
suggest that instead of invoking mdumps and mloads, the
pickle code include its own copies of these two simple
algorithms.

I haven't looked at cPickle, so I don't know whether it
calls the marshal code, or whether it implements the
algorithms itself. If the former, I suggest changing it
too to the latter.


----------------------------------------------------------------------

>Comment By: Tim Peters (tim_one)
Date: 2002-12-09 11:53

Message:
Logged In: YES 
user_id=31435

Closing this as Invalid.  So long as the doc's promises are 
kept, it doesn't matter how the implementation accomplishes 
it.  If the marshal format changes in an incompatible way 
someday, then pickle will have to stop using marshal 
routines.  Changing that beforehand isn't needed or helpful.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=650739&group_id=5470