﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
6468	nested ForNode iteration over non-sequence attributed to parent	Joshua Tacoma <joshua@…>	nobody	"When a `ForNode` contains a `ForNode` over a non-sequence, the resulting `TemplateSyntaxError` refers incorrectly to the first `ForNode.source`.
{{{
#!python
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'myproject.settings'
from django.template import Context, Template, TemplateSyntaxError
source = '''{% for item1 in list1 %}
{% for item2 in list2 %}
{% endfor %}
{% endfor %}'''
try:
    Template(source).render(Context(dict(list1=[1], list2=2)))
except TemplateSyntaxError, e:
    print source[e.source[1][0] : e.source[1][1]]
    print e.exc_info[1]
}}}
Ought to produce this output:
{{{
{% for item2 in list2 %}
iteration over non-sequence
}}}
But instead produces this:
{{{
{% for item1 in list1 %}
iteration over non-sequence
}}}
...which is quite misleading.  May be related to #4565?

I'll be studying the flow of `template/debug.py` and `template/defaulttags.py` but this is my first effort to fix a bug in Django so it's more of a learning exercise.  If you already know how to solve this, well, don't wait for me!"		closed	Template system	dev		duplicate			Unreviewed	0	0	0	0	0	0
