Commit c17f27d8 authored by Andreas Jung's avatar Andreas Jung

- Collector #1899: fixed migration issue when using export/import for

        ZCatalog instances
parent 346f4e7d
......@@ -26,6 +26,9 @@ Zope Changes
Bugs Fixed
- Collector #1899: fixed migration issue when using export/import for
ZCatalog instances
- 'ZPublisher.Test.publish' now takes a 'done_string' argument, which
is written to standard error when the request completes (forward
ported from Zope 2.7 branch).
......
......@@ -175,7 +175,15 @@ class UnIndex(SimpleItem):
except AttributeError:
# index row is an int
del self._index[entry]
try:
del self._index[entry]
except KeyError:
# XXX swallow KeyError because it was probably
# removed and then _length AttributeError raised
pass
if isinstance(self.__len__, BTrees.Length.Length):
self._length = self.__len__
del self.__len__
self._length.change(-1)
except:
......@@ -202,7 +210,14 @@ class UnIndex(SimpleItem):
# an IntSet and stuff it in first.
if indexRow is _marker:
self._index[entry] = documentId
self._length.change(1)
# XXX _length needs to be migrated to Length object
try:
self._length.change(1)
except AttributeError:
if isinstance(self.__len__, BTrees.Length.Length):
self._length = self.__len__
del self.__len__
self._length.change(1)
else:
try: indexRow.insert(documentId)
except AttributeError:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment