[ZCM] [ZC] 181/ 5 Assign "Splitter module"

Collector: Zope Bugs and Patches ... zope-coders@zope.org
Tue, 19 Mar 2002 13:29:50 -0500


Issue #181 Update (Assign) "Splitter module"
 Status Accepted, Catalog/bug medium
To followup, visit:
  http://collector.zope.org/Zope/181

==============================================================
= Assign - Entry #5 by stevea on Mar 19, 2002 1:29 pm

 Supporters added: chrism; removed: stevea

putting 

from ZopeSplitter import ZopeSplitter as Splitter

as the contents of 

lib/python/Products/PluginIndexes/TextIndex/Splitter/ZopeSplitter/__init__.py

fixes things.

I don't know whether this should be committed to trunk as a fix for legacy GlobbingLexicons, or whether this should just be a documented workaround.

So, I'm assigning this issue to Chris McD. who should be able to make a sensible decision.

________________________________________
= Comment - Entry #4 by stevea on Mar 19, 2002 1:19 pm

Ok, the problem is that some time in the past, a lexicon would have  held a reference to a ZopeSplitter.Splitter.

If I interactively add a Splitter to the ZopeSplitter module, I can load the persistent object.

Here's the serial of the faulty GlobbingLexicon instance:

'((U0Products.PluginIndexes.TextIndex.GlobbingLexiconq\x01U\x0fGlobbingLexiconq\x02tq\x03Nt.}q\x04(U\x08_lexiconq\x05(U\x08\x00\x00\x00\x00\x00\x02Z\x9dq\x06(U\x0eBTrees.OIBTreeq\x07U\x07OIBTreeq\x08ttQU\x08_digramsq\t(U\x08\x00\x00\x00\x00\x00\x02Z\x9eq\n(U\x0eBTrees.OOBTreeq\x0bU\x07OOBTreeq\x0cttQU\x0b_inverseLexq\r(U\x08\x00\x00\x00\x00\x00\x02Z\x9fq\x0e(U\x0eBTrees.IOBTreeq\x0fU\x07IOBTreeq\x10ttQU\x0cSplitterFuncq\x11cProducts.PluginIndexes.TextIndex.Splitter.ZopeSplitter\nSplitter\nq\x12U\x0buseSplitterq\x13U\x0cZopeSplitterq\x14u.'

Here's the serial of a new one:

'((U0Products.PluginIndexes.TextIndex.GlobbingLexiconq\x01U\x0fGlobbingLexiconq\x02tq\x03Nt.}q\x04(U\x08_lexiconq\x05(U\x08\x00\x00\x00\x00\x00\x03\x0c0q\x06(U\x0eBTrees.OIBTreeq\x07U\x07OIBTreeq\x08ttQU\x0b_inverseLexq\t(U\x08\x00\x00\x00\x00\x00\x03\x0c1q\n(U\x0fBTrees._IOBTreeq\x0bU\x07IOBTreeq\x0cttQU\x0esplitterParamsq\r(cZPublisher.HTTPRequest\nrecord\nq\x0eoq\x0f}q\x10(U\x14splitterIndexNumbersq\x11K\x01U\x13splitterSingleCharsq\x12K\x00U\x13splitterCasefoldingq\x13K\x01ubU\x0cSplitterFuncq\x14cProducts.PluginIndexes.TextIndex.Splitter.ZopeSplitter.ZopeSplitter\nZopeSplitter\nq\x15U\x08_digramsq\x16(U\x08\x00\x00\x00\x00\x00\x03\x0c2q\x17(U\x0eBTrees.OOBTreeq\x18U\x07OOBTreeq\x19ttQU\x0buseSplitterq\x1aU\x0cZopeSplitterq\x1bu.'

I think the most obvious fix is to put a new vocabulary into my catalog, and then update all my textindexes to use this new vocabulary.

As a workaround, aliasing ZopeSplitter as Splitter in ZopeSplitter/__init__.py should sort this out.

I'll try that, and if it works, submit that as the fix.


________________________________________
= Accept - Entry #3 by stevea on Mar 19, 2002 12:55 pm

 Status: Rejected => Accepted

 Supporters added: stevea

I have just come across this error on one of my servers.

I get this from the zope stupid log:

2002-03-19T17:35:24 ERROR(200) ZODB Couldn't load state for '\x00\x00\x00\x00\x00\x02Z\x9c'
Traceback (innermost last):
  File lib/python/ZODB/Connection.py, line 472, in setstate
AttributeError: 'module' object has no attribute 'Splitter'

And this from, after loading the object in question from app()._p_jar, trying to access its attributes:

Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "lib/python/ZODB/Connection.py", line 472, in setstate
    state = unpickler.load()
AttributeError: 'module' object has no attribute 'Splitter'

The object is a GlobbingLexicon instance.

I'm not sure what's going on here, but I'm looking into it.

________________________________________
= Reject - Entry #2 by chrisw on Jan 28, 2002 4:31 am

 Status: Pending => Rejected

The "no module named splitter" suggests Vincente hasn't managed to fully compile Zope properly.

Given that he submitted Anonymously here, he won't get followups so I'm going to reject this and try and hunt him down on the list...

cheers,

Chris
________________________________________
= Request - Entry #1 by Anonymous User on Jan 27, 2002 7:02 pm


The problems I have had is the "Unpickeable error", along with the "object not callable" and "no module named splitter". 

I have been keeping the searching through the list and as Dieter Mauer pointed, I have come up with the fact that the s'thing regarding the splitter module was changed since Zope 2.4.0.

In either Zope 2.4.3 and newly stabled 2.5.0 errors importing previous version developed products (squishdot sites (1.3.0) or ZUBB discussions (0.7.0/1) arise (mainly no module named splitter). 

I think that the imposibility to import to the upgraded version affects any product that uses the Vocabulary.(Zcatalog)

I have tried the solution provided in a mial dated 27/09/01 (Title:Importing errors), that suggested to write a script with the following code:

  from ZopeSplitter import *
  Splitter = ZopeSplitter

Unfortunately this doesn't work.

In a following mail with the same Title , it says that the __init__.py in ZopeSplitter directory should read:

   from ZopeSplitter import ZopeSplitter as Splitter

I dont know if that must be the right code. I've checked the __init__.py in my system (2.5.0) and it misses the "as Splitter" part. 

Tried to fix it including the as Splitter thing, but didn't work too.

I don't know if that is the right code, but it is not in the file. 

Is there a possibility that s'thing is missing in the Windows version of Zope 2.4.3 and 2.5.0 that forbid the compatibility of products developed in version 2.4.0 with the later versions ??? 

I don't know if that is a bug or not, but I am not able to import products developed in older versions, and that does not seem coherent at all.


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