Tornado: ERROR:tornado.application:Uncaught exception GET / (127.0.0.1)

Created on 10 Jan 2019  ·  4Comments  ·  Source: tornadoweb/tornado

ERROR:tornado.application:Uncaught exception GET / (127.0.0.1)
HTTPServerRequest(protocol='http', host='tornado', method='GET', uri='/', version='HTTP/1.0', remote_ip='127.0.0.1')

self.render(_config["template"], **template_data)
我在执行这个方法的时候报错
namespace.update(self.ui)
TypeError: 'NoneType' object is not iterable

但是执行self.write(template_data)却不报错

而且在执行self.write(template_data)后,再执行self.render(_config["template"], **template_data)却又不报错了。

不知道这是python的问题,还是tornado的问题
不知道有没有哪位朋友也遇到了上面的问题?

Most helpful comment

建议这类问题可以去 SegmentFault 上去问,或者问身边的开发,Github 的 issue 一般用来提项目本身的问题,在确认是 tornado 问题之前不建议在 issue 上提。

另外,这个项目的维护者是外国人,你用中文写,人家看不懂的。

All 4 comments

image

你的 self.ui 为 None 导致的问题,是使用 Python 出错导致的。dict 的 update 方法不能传 None 参数。

建议这类问题可以去 SegmentFault 上去问,或者问身边的开发,Github 的 issue 一般用来提项目本身的问题,在确认是 tornado 问题之前不建议在 issue 上提。

另外,这个项目的维护者是外国人,你用中文写,人家看不懂的。

谢谢

This is an english-language issue tracker; please write your issues in english or find a forum to seek help in your own language.

FWIW, this error can occur if you try to use render after the response has already been finalized.

Was this page helpful?
0 / 5 - 0 ratings