关于 bottle 的中文链接的问题

2016-11-28 16:58:48 +08:00
 flyeblue

关于 bottle 的中文链接的问题

我发现类似 “/z/讨厌啃苹果.html ”或者 “/z/%E8%AE%A8%E5%8E%8C%E5%95%83%E8%8B%B9%E6%9E%9C.html ”都会直接报错误“ Critical error while processing request ”,请问应该怎么解决?

1921 次点击
所在节点    Python
1 条回复
flyeblue
2016-11-28 17:15:31 +08:00
相关的错误提示:
Error:

RuntimeError('Request context not initialized.',)

Traceback:

Traceback (most recent call last):
File "C:\Users\Administrator\Anaconda3\lib\site-packages\bottle.py", line 1653, in fget
try: return ls.var
AttributeError: '_thread._local' object has no attribute 'var'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\Administrator\Anaconda3\lib\site-packages\bottle.py", line 954, in wsgi
out = self._cast(self._handle(environ))
File "C:\Users\Administrator\Anaconda3\lib\site-packages\bottle.py", line 907, in _cast
out = self.error_handler.get(out.status_code, self.default_error_handler)(out)
File "C:\Users\Administrator\Anaconda3\lib\site-packages\bottle.py", line 842, in default_error_handler
return tob(template(ERROR_PAGE_TEMPLATE, e=res))
File "C:\Users\Administrator\Anaconda3\lib\site-packages\bottle.py", line 3609, in template
return TEMPLATES[tplid].render(kwargs)
File "C:\Users\Administrator\Anaconda3\lib\site-packages\bottle.py", line 3399, in render
self.execute(stdout, env)
File "C:\Users\Administrator\Anaconda3\lib\site-packages\bottle.py", line 3386, in execute
eval(self.co, env)
File "<string>", line 17, in <module>
File "C:\Users\Administrator\Anaconda3\lib\site-packages\bottle.py", line 1249, in url
return self.urlparts.geturl()
File "C:\Users\Administrator\Anaconda3\lib\site-packages\bottle.py", line 165, in __get__
key, storage = self.key, getattr(obj, self.attr)
File "C:\Users\Administrator\Anaconda3\lib\site-packages\bottle.py", line 1655, in fget
raise RuntimeError("Request context not initialized.")
RuntimeError: Request context not initialized.

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/323880

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX