[Python-bugs-list] [ python-Bugs-751276 ] cPickle doesn't raise error, pickle does (recursiondepth)
SourceForge.net
noreply@sourceforge.net
Sat, 14 Jun 2003 07:23:32 -0700
Bugs item #751276, was opened at 2003-06-09 13:13
Message generated for change (Comment added) made by loewis
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=751276&group_id=5470
Category: Python Library
Group: None
>Status: Closed
>Resolution: Wont Fix
Priority: 5
Submitted By: Irmen de Jong (irmen)
Assigned to: Nobody/Anonymous (nobody)
Summary: cPickle doesn't raise error, pickle does (recursiondepth)
Initial Comment:
I have this object that causes a recursive call in the
__getattr__ method.
When I unpicke it using pickle, I get a runtimeerror
recursiondepth exceeded. When I unpickle it using
cPickle, everything appears to work -- no error is raised.
(tested on python 2.2.3 and 2.3b1)
The output of the attached python test file is:
***pickle***
Creating t...
Thing.__init__ name= myname
Pickle t...
Restore t...
FAIL!!! <exceptions.RuntimeError instance at
0x00951C68> maximum recursion depth exceeded
***cPickle***
Creating t...
Thing.__init__ name= myname
Pickle t...
Restore t...
SUCCESS!!! name= myname
----------------------------------------------------------------------
>Comment By: Martin v. Löwis (loewis)
Date: 2003-06-14 16:23
Message:
Logged In: YES
user_id=21627
This problem cannot be fixed. cPickle and pickle work
differently by nature; one is written in C, the other in
Python (as their names suggest).
You can try to sys.setrecursionlimit, to raise the nesting
level that pickle.py supports.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=751276&group_id=5470