[pypy-issue] Issue #2429: cPickle issue with revdb (pypy/pypy)

Tristan Seligmann issues-reply at bitbucket.org
Sat Nov 5 15:09:11 EDT 2016


New issue 2429: cPickle issue with revdb
https://bitbucket.org/pypy/pypy/issues/2429/cpickle-issue-with-revdb

Tristan Seligmann:

Minimal reproduction:
```
import cPickle
import pickle

class Cls(object):
    def __init__(self):
        self.plugins = []

obj = {'key': Cls()}
pickle.dumps(obj) # This works
cPickle.dumps(obj) # This does not
```
produces the following traceback:
```
Traceback (most recent call last):
  File "picklebug.py", line 10, in <module>
    cPickle.dumps(obj) # This does not
  File "/home/mithrandi/code/pypy/lib_pypy/cPickle.py", line 124, in dumps
    Pickler(file, protocol).dump(obj)
  File "/home/mithrandi/code/pypy/lib-python/2.7/pickle.py", line 224, in dump
    self.save(obj)
  File "/home/mithrandi/code/pypy/lib-python/2.7/pickle.py", line 286, in save
    f(self, obj) # Call unbound method with explicit self
  File "/home/mithrandi/code/pypy/lib-python/2.7/pickle.py", line 653, in save_dict
    self._batch_setitems(obj.iteritems())
  File "/home/mithrandi/code/pypy/lib-python/2.7/pickle.py", line 667, in _batch_setitems
    save(v)
  File "/home/mithrandi/code/pypy/lib-python/2.7/pickle.py", line 331, in save
    self.save_reduce(obj=obj, *rv)
  File "/home/mithrandi/code/pypy/lib-python/2.7/pickle.py", line 401, in save_reduce
    save(args)
  File "/home/mithrandi/code/pypy/lib-python/2.7/pickle.py", line 286, in save
    f(self, obj) # Call unbound method with explicit self
  File "/home/mithrandi/code/pypy/lib-python/2.7/pickle.py", line 562, in save_tuple
    save(element)
  File "/home/mithrandi/code/pypy/lib-python/2.7/pickle.py", line 286, in save
    f(self, obj) # Call unbound method with explicit self
  File "/home/mithrandi/code/pypy/lib-python/2.7/pickle.py", line 812, in save_global
    self.memoize(obj)
  File "/home/mithrandi/code/pypy/lib_pypy/cPickle.py", line 112, in memoize
    return PythonPickler.memoize(self, obj)
  File "/home/mithrandi/code/pypy/lib-python/2.7/pickle.py", line 244, in memoize
    assert id(obj) not in self.memo
AssertionError
```
My pypy-revdb was built from a740348ea339 on the reverse-debugger branch; regular pypy 5.4.1 doesn't seem to have the same bug.




More information about the pypy-issue mailing list