﻿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
10216	TEMPLATE_DEBUG / TemplateSyntaxError handling doesn't play nice with Jinja2	miracle2k	nobody	"Django's error 500 page code in ''views/debug.py'' probes exceptions for a ''source'' attribute, and if it exists, expects it to contain a 2-tuple pointing to the location where the error occurred.

Jinja2's ''TemplateSyntaxError'' also features a ''source'' attribute, but it instead contains the source string of the template.

As a result, when Jinja2 is used for templating and such an error occurs, Django breaks down while trying to build an error page for it. Instead, you get a simple WSGI strack trace for the new problem, rather than the actual template exception. The problem is this line:

{{{
origin, (start, end) = self.exc_value.source
}}}

I would argue that Django assumption that the existence of an attribute named ''source'' implies a specific protocol is flawed. It should either check for a specific class (though there are appear to be multiple), or at least make sure that it ignores values it can't handle."		closed	Template system	dev		fixed			Accepted	1	0	0	0	0	0
