pickle: maximum recursion depth exceeded

Anthony Briggs abriggs at westnet.com.au
Mon Nov 3 05:15:02 EST 2003


At 11:29 AM +1100 3/11/03, Simon Burton wrote:
>Hi,
>
>I am pickling big graphs of data and running into this problem:
>
>[...]
>   File "/usr/lib/python2.2/pickle.py", line 225, in save
>     f(self, object)
>   File "/usr/lib/python2.2/pickle.py", line 414, in save_list
>     save(element)

...

>   File "/usr/lib/python2.2/pickle.py", line 225, in save
>     f(self, object)
>   File "/usr/lib/python2.2/pickle.py", line 405, in save_list
>     write(self.put(memo_len))
>RuntimeError: maximum recursion depth exceeded
>
>However, it works when i try the smallest examples and use
>sys.setrecursionlimit(4000)
>
>This seems like a limitation in the pickling code. Yes?

I would suspect that you have a loop in your definitions, eg. A 
imports B, and B imports A, particularly since you're trying small 
examples, and they're still exceeding the recursion depth.

Hope that helps,

Anthony
-- 
----------------------------------------------------
HyPEraCtiVE? HeY, WhO aRE YoU cALliNg HypERaCtIve?!
aBRiGgS at wEStNeT.cOm.aU
----------------------------------------------------





More information about the Python-list mailing list