Edgewall Software

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#60 closed defect (fixed)

"TypeError: iteration over non-sequence" in py:for instead of an error

Reported by: s.lipnevich@… Owned by: cmlenz
Priority: minor Milestone: 0.3.2
Component: Template processing Version: 0.3.1
Keywords: Cc:


The fragment <div py:for="i in c.items"/> fails if c.items is a valid instance but not an iterable (happens for me when using Genshi with Pylons). The failure is expected, but I suppose Genshi could provide a better error message that shows line and column where this happens. Here's the tail of a sample trace:

  File "/usr/lib/python2.4/site-packages/Pylons-0.9.2-py2.4.egg/pylons/templating.py", line 288, in render_response
    response = pylons.Response(render(*args, **kargs))
  File "/usr/lib/python2.4/site-packages/Pylons-0.9.2-py2.4.egg/pylons/templating.py", line 273, in render
    namespace=kargs, **cache_args)
  File "/usr/lib/python2.4/site-packages/Pylons-0.9.2-py2.4.egg/pylons/templating.py", line 196, in render
    return engine_config['engine'].render(namespace, template=full_path, **options)
  File "build/bdist.linux-x86_64/egg/genshi/plugin.py", line 74, in render
  File "build/bdist.linux-x86_64/egg/genshi/core.py", line 141, in render
  File "build/bdist.linux-x86_64/egg/genshi/output.py", line 329, in __call__
  File "build/bdist.linux-x86_64/egg/genshi/output.py", line 485, in __call__
  File "build/bdist.linux-x86_64/egg/genshi/output.py", line 433, in __call__
  File "build/bdist.linux-x86_64/egg/genshi/core.py", line 202, in _ensure
  File "build/bdist.linux-x86_64/egg/genshi/filters.py", line 147, in __call__
  File "build/bdist.linux-x86_64/egg/genshi/template.py", line 1101, in _match
  File "build/bdist.linux-x86_64/egg/genshi/filters.py", line 147, in __call__
  File "build/bdist.linux-x86_64/egg/genshi/template.py", line 1076, in _match
  File "build/bdist.linux-x86_64/egg/genshi/template.py", line 1065, in _strip
  File "build/bdist.linux-x86_64/egg/genshi/template.py", line 859, in _eval
  File "build/bdist.linux-x86_64/egg/genshi/template.py", line 917, in _flatten
  File "build/bdist.linux-x86_64/egg/genshi/template.py", line 917, in _flatten
  File "build/bdist.linux-x86_64/egg/genshi/template.py", line 911, in _flatten
  File "build/bdist.linux-x86_64/egg/genshi/template.py", line 428, in __call__
TypeError: iteration over non-sequence

Attachments (0)

Change History (3)

comment:1 Changed 9 years ago by cmlenz

  • Component changed from Expression evaluation to Template processing
  • Milestone set to 0.4
  • Priority changed from major to minor
  • Status changed from new to assigned

comment:2 Changed 9 years ago by cmlenz

  • Resolution set to fixed
  • Status changed from assigned to closed

Should be fixed in [346].

comment:3 Changed 9 years ago by cmlenz

  • Milestone changed from 0.4 to 0.3.2

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain cmlenz.
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.