[ZCM] [ZC] 1899/ 4 Comment "catalogs in .zexp from 2.7 dont import in 2.8"

Collector: Zope Bugs, Features, and Patches ... zope-coders-admin at zope.org
Fri Sep 16 02:07:27 EDT 2005


Issue #1899 Update (Comment) "catalogs in .zexp from 2.7 dont import in 2.8"
 Status Accepted, Zope/bug medium
To followup, visit:
  http://www.zope.org/Collectors/Zope/1899

==============================================================
= Comment - Entry #4 by ajung on Sep 16, 2005 2:07 am

Providing a solution as monkey-patch would be the best solution. However we should not the __setstate__ patch to the core...I just had pain enough removing the old magggggggggggic with __len__ and I don't want to see a new magic (I consider __setstate__ as magic :-))
________________________________________
= Accept - Entry #3 by tseaver on Sep 15, 2005 10:22 am

 Status: Resolved => Accepted

 Supporters added: tseaver

The patch seems a little iffy to me, given that the OP didn't know exactly how the various exceptions (e.g., the KeyError in the 
first stanza) could be raised.

Given that the bug only affects people doing something unusual (trying to import a .zexp file containing a whole CMF site), and that it introduces iffy behavior in a very-frequently used pair of methods, I think perhaps we should revert.

I discussed this with the OP on IRC:  another workaround would be to patch a '__setstate__' into the index class, which would convert the '__len__' at unpickling;  that would allow the user to import the site, and then run 'manage_convertIndexes' on its catalog.  If we made that '__setstate__' as a monkey-patch product, then it could be in effect only during the export / import part of the conversion product.

________________________________________
= Resolve - Entry #2 by ajung on Sep 15, 2005 2:02 am

 Status: Pending => Resolved

Patch applied to SVN trunk (r38478) and 2.8 branch (r38477).
________________________________________
= Request - Entry #1 by runyaga on Sep 14, 2005 2:18 am


Uploaded:  "UnIndex.py.diff"
 - http://www.zope.org/Collectors/Zope/1899/UnIndex.py.diff/view
In Zope 2.8 you are recommeneded to run covertIndexes on all
catalogs.  But if you export a catalog from 2.7 and import it
into 2.8 - there is no way to run covertIndexes.  What seems
to bomb is in PluginInxes/common/UnIndex.py where the internal
state of the indexes are referring to _length for BTrees.Length.Length
but the older indexes attribute is __len__.  So we have to try/except AttrError
around this and migrate in-place.  

NOTE: after I imported I still had to run catalog/manage_convertIndexes


==============================================================



More information about the Zope-Collector-Monitor mailing list