TALES: ?key access fails if key is an integer

Bug #143263 reported by Andreas Jung
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:

Tags: bug zope
affects: zope2 → zope.tales
summary: - TALES: ?key acces fails if key is an integer
+ TALES: ?key access fails if key is an integer
Revision history for this message
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
Revision history for this message
Tres Seaver (tseaver) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.