Edgewall Software

Ticket #60 (closed defect: fixed)

Opened 8 years ago

Last modified 8 years ago

"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:

Description

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

Change History

Changed 8 years ago by cmlenz

  • priority changed from major to minor
  • status changed from new to assigned
  • component changed from Expression evaluation to Template processing
  • milestone set to 0.4

Changed 8 years ago by cmlenz

  • status changed from assigned to closed
  • resolution set to fixed

Should be fixed in [346].

Changed 8 years ago by cmlenz

  • milestone changed from 0.4 to 0.3.2

Add/Change #60 ("TypeError: iteration over non-sequence" in py:for instead of an error)

Author


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


Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.