Commit ad70e9bc by James Tanner

Fixes #6227 skip non-unicode strings and catch decode errors silently in template_from_string

parent 8eb547ed
......@@ -310,7 +310,13 @@ def template_from_string(basedir, data, vars, fail_on_undefined=False):
if os.path.exists(filesdir):
basedir = filesdir
data = data.decode('utf-8')
# 6227
if isinstance(data, unicode):
try:
data = data.decode('utf-8')
except UnicodeEncodeError, e:
pass
try:
t = environment.from_string(data)
except Exception, e:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment