copy corrupts BTrees.Length.Length instances
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ZODB |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Copying BTrees.
>>> from BTrees.Length import Length
>>> import copy
>>> l = Length()
>>> print l()
0
>>> c = copy.deepcopy(l)
>>> print c()
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/home/
return self.value
AttributeError: 'Length' object has no attribute 'value'
This failure occurs because Length returns its stored value as the result of __getstate__, and the copy module's _reconstruct function uses the state value as a condition. It is a bug in copy (pickling/
Changed in zodb: | |
status: | New → Fix Committed |
This bug is reported on the Python bugtracker as http:// bugs.python. org/issue7848 .