[issue3043] Recursion bug in deepcopy

Alexandre Vassalotti report at bugs.python.org
Fri Jun 6 01:50:21 CEST 2008


Alexandre Vassalotti <alexandre at peadrop.com> added the comment:

Your graph is simply too deep for Python to handle it. The copy module
(and also the pickle) pushes a new stack frame every time a new
container object is encountered. Therefore, there is a recursion limit
to prevent the interpreter from crashing.

If you want, you can carefully increase the limit by using the function
`sys.setrecursionlimit`. Using your example:

   >>> sys.setrecursionlimit(2000)
   >>> g2 = copy.deepcopy(g)
   >>> # no error

----------
nosy: +alexandre.vassalotti

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3043>
_______________________________________


More information about the Python-bugs-list mailing list