webpy/webpy — Issue #128: debug mode  Not supported  Simplified Chinese  
Author: cj1324
Created: 2011-12-24 04:48:53+00:00
State: open

13 from web.httpserver import runsimple
14 #from web.webapi import config
15 #config.debug=True #TODO debug
16 from index import application;
17
18
19 if __name__ == u"__main__":
20 runsimple(application)
21

13 class Manage_Login:
14 def GET(self):
15 raise Exception(u'Not 中文 Found 404')
16 return u'info '

>>Browser Page:
Traceback (most recent call last):
File "/usr/lib64/python2.7/site-packages/web/wsgiserver/__init__.py", line 1174, in communicate
req.respond()
File "/usr/lib64/python2.7/site-packages/web/wsgiserver/__init__.py", line 544, in respond
self._respond()
File "/usr/lib64/python2.7/site-packages/web/wsgiserver/__init__.py", line 558, in _respond
for chunk in response:
File "/usr/lib64/python2.7/site-packages/web/utils.py", line 353, in safestr
return str(obj)
File "/usr/lib64/python2.7/site-packages/web/template.py", line 1254, in __str__
return self["__body__"].encode('utf-8')
File "/usr/lib64/python2.7/site-packages/web/template.py", line 1247, in __getitem__
self["__body__"] = u"".join(self._data)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 4: ordinal not in range(128)

Remove '中文 ' is OK!