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.

Author cwitty
Recipients cwitty
Date 2009-04-19.19:52:58
SpamBayes Score 4.7110582e-08
Marked as misclassified No
Message-id <1240170780.68.0.204813353535.issue5794@psf.upfronthosting.co.za>
In-reply-to
Content
When I try to pickle a recursive tuple (that recurses through a list),
pickle can load the result but cPickle fails with "unpickling stack
overflow".

(I just downloaded and built Python 2.6.2 on 64-bit x86 Debian testing
to verify this bug; it also fails on Python 2.5.2 on 32-bit x86 Debian
testing.  I think that probably it doesn't depend on the architecture or
operating system at all.)

Here is the test case.  At the end, cPickle.loads raises an exception;
instead, it should produce an object equivalent to v, like pickle.loads
does.  (I didn't show it in the test case, but pickles produced by
pickle.dumps have the same behavior -- they work with pickle.loads but
not cPickle.loads.)

>>> v = ([],)
>>> v[0].append(v)
>>> import pickle
>>> import cPickle
>>> v
([([...],)],)
>>> vp = cPickle.dumps(v)
>>> pickle.loads(vp)
([([...],)],)
>>> cPickle.loads(vp)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
cPickle.UnpicklingError: unpickling stack underflow
History
Date User Action Args
2009-04-19 19:53:00cwittysetrecipients: + cwitty
2009-04-19 19:53:00cwittysetmessageid: <1240170780.68.0.204813353535.issue5794@psf.upfronthosting.co.za>
2009-04-19 19:52:59cwittylinkissue5794 messages
2009-04-19 19:52:58cwittycreate