﻿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
14040	Python syntax errors in module loading propagate up	jt@…	nobody	"When template tags trigger the importing of modules with syntax errors, import(name) in django/utils/importlib.py raises a SyntaxError which isn't caught, and leads to confusing warnings about template syntax errors at a higher level. One solution is to trap SyntaxErrors there and wrap them as ImportErrors, which are trapped higher up.

e.g.:

django/utils/importlib.py:35
{{{
    try:
        __import__(name)
    except SyntaxError, e:
        raise ImportError(""Syntax error in "" + e.filename + "" at line "" + str(e.lineno) + ""("" + str(e.offset) + ""): \"""" + e.text + ""\""."")
}}}"	Cleanup/optimization	closed	Core (Other)	1.2	Normal	needsinfo			Accepted	0	0	0	0	0	0
