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="">
<span tal:repeat="line here/sponsors" tal:omit-tag="">
<h5 tal:content="line" />

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...

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
    * Module Products.PageTemplates.PageTemplate, line 96, in pt_render
      <PageTemplateFile at
    * 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] != ''>

{'container': <GTIGalleryItem at
 'context': <GTIGalleryItem at
 'default': <Products.PageTemplates.TALES.Default instance at
 'here': <GTIGalleryItem at
 'loop': <SafeMapping instance at 40f297c0>,
 'modules': <Products.PageTemplates.ZRPythonExpr._SecureModuleImporter
instance at 0x40acccac>,
 'nothing': None,
 'options': {'args': ()},
 'repeat': <SafeMapping instance at 40f297c0>,
 'request': <HTTPRequest,
 'root': <Application instance at 4189acb0>,
 'template': <PageTemplateFile at
 '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
    * Module AccessControl.ZopeGuards, line 67, in guarded_getitem

IndexError: tuple index out of range

Start your day with Yahoo! - make it your home page 
Zope maillist  -  Zope@zope.org
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to