This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: cPickle doesn't raise error, pickle does (UnpicklingError)
Type: Stage:
Components: None Versions: Python 2.2
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: irmen
Priority: normal Keywords:

Created on 2003-06-09 11:21 by irmen, last changed 2022-04-10 16:09 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
nopickle-safe.py irmen, 2003-06-09 11:21 test script
Messages (1)
msg16296 - (view) Author: Irmen de Jong (irmen) (Python triager) Date: 2003-06-09 11:21
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
History
Date User Action Args
2022-04-10 16:09:06adminsetgithub: 38615
2003-06-09 11:21:52irmencreate