Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PageTemplates: "length" of repeat variables broken #913

Closed
d-maurer opened this issue Oct 9, 2020 · 0 comments · Fixed by #918
Closed

PageTemplates: "length" of repeat variables broken #913

d-maurer opened this issue Oct 9, 2020 · 0 comments · Fixed by #918
Assignees
Labels

Comments

@d-maurer
Copy link
Contributor

d-maurer commented Oct 9, 2020

BUG/PROBLEM REPORT

Reproduction:

>>> from zope.component import provideAdapter
>>> from zope.traversing.adapters import DefaultTraversable
>>> from Products.PageTemplates.PageTemplate import PageTemplate
>>> from Products.PageTemplates.tests.util import useChameleonEngine
>>> useChameleonEngine(); provideAdapter(DefaultTraversable, (None,))
>>> t = PageTemplate()
>>> t.write('<tal:repeat repeat="x options/seq" content="repeat/x/length" />')
>>> t(seq="abc")
Traceback (most recent call last):
 ...
  File "...Products/PageTemplates/Expressions.py", line 126, in render
    ob = ob()
  File "...zope.tales/src/zope/tales/tales.py", line 526, in length
    return len(self._seq)
TypeError: object of type 'list_iterator' has no len()
...
 - Expression: "repeat/x/length"
 - Filename:   <string>
 - Location:   (line 1: col 44)
 - Arguments:  template: <Products.PageTemplates.PageTemplate.PageTemplate object at 0x7fa804c59d30>
               options: {'seq': 'abc', 'args': ()}
...

Zope 4.x/5.x

@d-maurer d-maurer added the bug label Oct 9, 2020
@d-maurer d-maurer self-assigned this Oct 9, 2020
d-maurer added a commit that referenced this issue Oct 9, 2020
d-maurer added a commit that referenced this issue Oct 9, 2020
d-maurer added a commit that referenced this issue Oct 11, 2020
d-maurer added a commit that referenced this issue Oct 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant