[Zope] getPhysicalPath() returns list inside a tuple!!! zope bug?

fsdklj fdsl zopezope@yahoo.com
Thu, 4 Apr 2002 07:16:53 -0800 (PST)


ok, this is pretty weird and looks like a zope bug to
me.

I'm trying to set up ZCatalog to index some objects:
when I do "find objects" -> "DTML document" 
works fine, when I try to index a custom product
i made, this error comes out

    (Object: catalog)
  File ./lib/python/Products/ZCatalog/Catalog.py, line
296, in catalogObject
  File
/usr/local/zope/lib/python/Products/PluginIndexes/PathIndex/PathIndex.py,
line 100, in index_object
    (Object: path)
TypeError: sequence item 4: expected string, list
found


I modified PathIndex.py to get some debug info like
this:


        print "PP: %s" % str(obj.getPhysicalPath())
        
        if hasattr(obj,self.id):
            f = getattr(obj,self.id)
            try:
                if callable(f): path = f()
                else:           path = f
            except:
                return 0

        else:             
            try:
                path = obj.getPhysicalPath()
            except:
                return 0

        print "path-> %s" % (path, )
        if type(path) in (ListType,TupleType):
            path = '/'+ '/'.join(path[1:])


and the output is:
PP: ('', 'sites', 'simplesky', 'AAA', '.creation')
path-> ('', 'sites', 'simplesky', 'AAA', '.creation')
PP: ('', 'sites', 'simplesky', 'AAA', 'maindata',
'user')
path-> ('', 'sites', 'simplesky', 'AAA', 'maindata',
'user')
PP: ('', 'sites', 'simplesky', 'AAA', 'maindata',
['.en', '.en'], '.creation')
path-> ('', 'sites', 'simplesky', 'AAA', 'maindata',
['.en', '.en'], '.creation')



as you can see the last object has a strange
getPhysicalPath() value
('', 'sites', 'simplesky', 'AAA', 'maindata', ['.en',
'.en'], '.creation')

what is ['.en', '.en'] doing in it?

of course 
path = '/'+ '/'.join(path[1:]) 

chokes on it and that's where the error is coming
from.

My products never use/define/redefine
getPhysicalPath().
what's going on?????


Any help will be really appreciated.

Thanks


__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/