[Zope] upgrade 2.5.1 to 2.7.5 causes error in product code

John Schinnerer johnschinnerer at yahoo.com
Sat Aug 27 01:50:54 EDT 2005


Hello,

I have just migrated some custom products from 2.5.1 to 2.7.5, meaning
from python 2.1.3 to 2.3.5.

I have this bit of code in the index_html page template in the product,
which rendered just fine in zope 2.5.1/python 2.1.3:

<span tal:condition="python:here.sponsors[0] != ''" tal:omit-tag="">
<h4>Sponsors</h4>
<span tal:repeat="line here/sponsors" tal:omit-tag="">
<h5 tal:content="line" />
</span>
</span>

sponsors is a lines property in the custom product, like so:

{'id':'sponsors', 'type':'lines', 'mode':'w'},

Now, in zope 2.7.5/python 2.3.5, I get an error on this part of the
above code:

python:here.sponsors[0] != ''

as follows:

Exception Type  	IndexError
Exception Value 	tuple index out of range

Can anyone tell me what's up with this?
It worked fine in 2.5.1, now it gives this error in 2.7.5...help...

Thanks,
John S.

And here's the complete...

Traceback (innermost last):

    * Module ZPublisher.Publish, line 101, in publish
    * Module ZPublisher.mapply, line 88, in mapply
    * Module ZPublisher.Publish, line 39, in call_object
    * Module Shared.DC.Scripts.Bindings, line 306, in __call__
    * Module Shared.DC.Scripts.Bindings, line 343, in _bindAndExec
    * Module Products.PageTemplates.PageTemplateFile, line 106, in
_exec
    * Module Products.PageTemplates.PageTemplate, line 96, in pt_render
      <PageTemplateFile at
/growingthroughit.org/galleryitems/bg/tw0110/index_html>
    * Module TAL.TALInterpreter, line 190, in __call__
    * Module TAL.TALInterpreter, line 234, in interpret
    * Module TAL.TALInterpreter, line 671, in do_useMacro
    * Module TAL.TALInterpreter, line 234, in interpret
    * Module TAL.TALInterpreter, line 694, in do_defineSlot
    * Module TAL.TALInterpreter, line 234, in interpret
    * Module TAL.TALInterpreter, line 636, in do_condition
    * Module Products.PageTemplates.TALES, line 221, in evaluate
      URL: index_html
      Line 58, Column 0
      Expression: <PythonExpr here.sponsors[0] != ''>
      Names:

{'container': <GTIGalleryItem at
/growingthroughit.org/galleryitems/bg/tw0110>,
 'context': <GTIGalleryItem at
/growingthroughit.org/galleryitems/bg/tw0110>,
 'default': <Products.PageTemplates.TALES.Default instance at
0x40ad2aec>,
 'here': <GTIGalleryItem at
/growingthroughit.org/galleryitems/bg/tw0110>,
 'loop': <SafeMapping instance at 40f297c0>,
 'modules': <Products.PageTemplates.ZRPythonExpr._SecureModuleImporter
instance at 0x40acccac>,
 'nothing': None,
 'options': {'args': ()},
 'repeat': <SafeMapping instance at 40f297c0>,
 'request': <HTTPRequest,
URL=http://www.growingthroughit.org/galleryitems/bg/tw0110/index_html>,
 'root': <Application instance at 4189acb0>,
 'template': <PageTemplateFile at
/growingthroughit.org/galleryitems/bg/tw0110/index_html>,
 'traverse_subpath': [],
 'user': Anonymous User}

    * Module Products.PageTemplates.ZRPythonExpr, line 47, in __call__
      __traceback_info__: here.sponsors[0] != ''
    * Module Python expression "here.sponsors[0] != ''", line 1, in
<expression>
    * Module AccessControl.ZopeGuards, line 67, in guarded_getitem

IndexError: tuple index out of range




		
____________________________________________________
Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 


More information about the Zope mailing list