[Python-bugs-list] [ python-Bugs-751279 ] cPickle doesn't raise error, pickle does (UnpicklingError)

SourceForge.net noreply@sourceforge.net
Mon, 09 Jun 2003 04:21:52 -0700


Bugs item #751279, was opened at 2003-06-09 13:21
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=751279&group_id=5470

Category: None
Group: Python 2.2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Irmen de Jong (irmen)
Assigned to: Nobody/Anonymous (nobody)
Summary: cPickle doesn't raise error, pickle does (UnpicklingError)

Initial Comment:
I have this object with a __getinitargs__ method. 
When I try to unpickle it using pickle, it raises an
UnpicklingError: not safe for unpickling.
When unpickling with cPickle, everything appears to
work (no error is raised).

Tested on Python 2.2.3.  This issue doesn't appear on
Python 2.3b1.

The output of the attached test script is:

***pickle***
Creating t...
Pickle t...
Restore t...
FAIL!!!  <pickle.UnpicklingError instance at
0x008A2D90> __main__.Thing is not safe for unpickling
***cPickle***
Creating t...
Pickle t...
Restore t...
SUCCESS!!! name= myname


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

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