TALES: ?key access fails if key is an integer

Bug #143263 reported by Andreas Jung on 2004-12-17
2
Affects Status Importance Assigned to Milestone
zope.tales
Won't Fix
Medium
Unassigned

Bug Description

<tal:define tal:define="somedict python: {0:'1'};
                        key python: 0">

  <span tal:content="somedict/?key"/>
</tal:define>

fails:

Time
    2004/12/17 15:13:58.055 GMT+1
User Name (User Id)
    ajung (ajung)
Request URL
    http://zopyx.com/tmp/p1
Exception Type
    TypeError
Exception Value
    iteration over non-sequence

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.ZopePageTemplate, line 222, in _exec
    * Module Products.PageTemplates.PageTemplate, line 96, in pt_render
      <ZopePageTemplate at /zopyx/tmp/p1>
    * Module TAL.TALInterpreter, line 190, in __call__
    * Module TAL.TALInterpreter, line 234, in interpret
    * Module TAL.TALInterpreter, line 409, in do_optTag_tal
    * Module TAL.TALInterpreter, line 394, in do_optTag
    * Module TAL.TALInterpreter, line 389, in no_tag
    * Module TAL.TALInterpreter, line 234, in interpret
    * Module TAL.TALInterpreter, line 484, in do_insertText_tal
    * Module Products.PageTemplates.TALES, line 227, in evaluateText
    * Module Products.PageTemplates.TALES, line 221, in evaluate
      URL: /zopyx/tmp/p1
      Line 4, Column 2
      Expression: standard:'somedict/?key'
      Names:

affects: zope2 → zope.tales
summary: - TALES: ?key acces fails if key is an integer
+ TALES: ?key access fails if key is an integer
Tres Seaver (tseaver) wrote :

When we document the '?' syntax for elements in a path expression, we
will specify that the value of the sub-key expression must be a string.

Changed in zope.tales:
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers