Archive for July, 2011
The Tornado web-server doesn’t like writing int’s
by David Dolphin on Jul.16, 2011, under Work
Tornado (a Python based web-server) doesn’t like writing int’s. However, it will write strings and dicts. Casting to a string solves the problem.
This is the error traceback I was seeing. The server was returning a 500 error.
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/tornado/web.py", line 927, in _execute
getattr(self, self.request.method.lower())(*args, **kwargs)
File "second_breakfast.py", line 10, in get
self.write(result)
File "/usr/lib/python2.7/site-packages/tornado/web.py", line 446, in write
chunk = utf8(chunk)
File "/usr/lib/python2.7/site-packages/tornado/escape.py", line 159, in utf8
assert isinstance(value, unicode)
AssertionError
