UnicodeDecodeError in template #991

Open
jason64 opened this Issue Feb 23, 2014 · 1 comment

Projects

None yet

3 participants

jason64 commented Feb 23, 2014

If the template_path setting is an unicode string and some template file contains non-ASCII characters, then tornado raises the following exception:

...
  File "/home/venv/local/lib/python2.7/site-packages/tornado/template.py", line 633, in write_line
    print("    " * indent + line + line_comment, file=self.file)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 18: ordinal not in range(128)

Cause of the exception: the line variable is a str object containing non-ASCII characters and the line_comment variable is an unicode object.

tdMulga commented May 23, 2014

Hello. See tiket #1027, it contains answer for this issue.

@bdarnell bdarnell added the template label Jul 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment