[Zope-Checkins] SVN: Zope/branches/Zope-2_8-branch/ - Collector #1899: fixed migration issue when using export/import for

Andreas Jung andreas at andreas-jung.com
Thu Sep 15 02:11:43 EDT 2005


Log message for revision 38477:
        - Collector #1899: fixed migration issue when using export/import for
          ZCatalog instances
  

Changed:
  U   Zope/branches/Zope-2_8-branch/doc/CHANGES.txt
  U   Zope/branches/Zope-2_8-branch/lib/python/Products/PluginIndexes/common/UnIndex.py

-=-
Modified: Zope/branches/Zope-2_8-branch/doc/CHANGES.txt
===================================================================
--- Zope/branches/Zope-2_8-branch/doc/CHANGES.txt	2005-09-15 00:43:59 UTC (rev 38476)
+++ Zope/branches/Zope-2_8-branch/doc/CHANGES.txt	2005-09-15 06:11:40 UTC (rev 38477)
@@ -26,6 +26,9 @@
 
     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).

Modified: Zope/branches/Zope-2_8-branch/lib/python/Products/PluginIndexes/common/UnIndex.py
===================================================================
--- Zope/branches/Zope-2_8-branch/lib/python/Products/PluginIndexes/common/UnIndex.py	2005-09-15 00:43:59 UTC (rev 38476)
+++ Zope/branches/Zope-2_8-branch/lib/python/Products/PluginIndexes/common/UnIndex.py	2005-09-15 06:11:40 UTC (rev 38477)
@@ -175,7 +175,15 @@
 
             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 @@
         # 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:



More information about the Zope-Checkins mailing list