]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Make template constructor accept unicode strings
authorBen Darnell <ben@bendarnell.com>
Sat, 16 Apr 2011 20:23:39 +0000 (13:23 -0700)
committerBen Darnell <ben@bendarnell.com>
Sat, 16 Apr 2011 20:23:55 +0000 (13:23 -0700)
Closes #244

tornado/template.py

index 34dc0689e7b80beec673da438186caabc55b8a37..ff8bbba98f3ff152c24b488aefd163f1574ce047 100644 (file)
@@ -101,7 +101,7 @@ class Template(object):
         if compress_whitespace is None:
             compress_whitespace = name.endswith(".html") or \
                 name.endswith(".js")
-        reader = _TemplateReader(name, template_string)
+        reader = _TemplateReader(name, escape.utf8(template_string))
         self.file = _File(_parse(reader))
         self.code = self._generate_python(loader, compress_whitespace)
         try: