Message86177
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 |
|
Date |
User |
Action |
Args |
2009-04-19 19:53:00 | cwitty | set | recipients:
+ cwitty |
2009-04-19 19:53:00 | cwitty | set | messageid: <1240170780.68.0.204813353535.issue5794@psf.upfronthosting.co.za> |
2009-04-19 19:52:59 | cwitty | link | issue5794 messages |
2009-04-19 19:52:58 | cwitty | create | |
|