[issue5794] pickle/cPickle of recursive tuples create pickles that cPickle can't load

Collin Winter report at bugs.python.org
Fri Apr 24 18:51:25 CEST 2009


Collin Winter <collinw at gmail.com> added the comment:

Interestingly, it only fails with protocol 0:

>>> v = ([],)
>>> v[0].append(v)
>>> import pickle,cPickle
>>> cPickle.loads(pickle.dumps(v, 0))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
cPickle.UnpicklingError: unpickling stack underflow
>>> cPickle.loads(pickle.dumps(v, 1))
([([...],)],)
>>> cPickle.loads(pickle.dumps(v, 2))
([([...],)],)
>>>


I'll see if I can come up with a fix.

----------
assignee:  -> collinwinter

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


More information about the Python-bugs-list mailing list