当我使用https://stackoverflow.com/a/13821624/3164117和a blog post推荐的代码app.wsgi_app = DebuggedApplication(app)
时,我得到了一个格式精美的错误,Flask调试器显示完美。没有那行代码,就没有错误,我现有的代码工作正常。
确切的错误是:
File "/Users/DanielFranklin/Desktop/etch/etchcode/lib/flask/app.py", line 1969, in __call__
return self.wsgi_app(environ, start_response)
File "/Users/DanielFranklin/Desktop/etch/etchcode/lib/werkzeug/debug/__init__.py", line 166, in __call__
if request.args.get('__debugger__') == 'yes':
File "/Users/DanielFranklin/Desktop/etch/etchcode/lib/werkzeug/utils.py", line 71, in __get__
value = self.func(obj)
File "/Users/DanielFranklin/Desktop/etch/etchcode/lib/werkzeug/wrappers.py", line 429, in args
cls=self.parameter_storage_class)
File "/Users/DanielFranklin/Desktop/etch/etchcode/lib/werkzeug/urls.py", line 723, in url_decode
include_empty, errors))
File "/Users/DanielFranklin/Desktop/etch/etchcode/lib/werkzeug/datastructures.py", line 373, in __init__
for key, value in mapping or ():
File "/Users/DanielFranklin/Desktop/etch/etchcode/lib/werkzeug/urls.py", line 779, in _url_decode_impl
key = url_unquote_plus(key, charset, errors)
File "/Users/DanielFranklin/Desktop/etch/etchcode/lib/werkzeug/urls.py", line 545, in url_unquote_plus
return url_unquote(s, charset, errors)
File "/Users/DanielFranklin/Desktop/etch/etchcode/lib/werkzeug/urls.py", line 522, in url_unquote
rv = _unquote_to_bytes(string, unsafe)
File "/Users/DanielFranklin/Desktop/etch/etchcode/lib/werkzeug/urls.py", line 351, in _unquote_to_bytes
if isinstance(string, text_type):
RuntimeError: maximum recursion depth exceeded while calling a Python object
答案 0 :(得分:1)
如同您引用的帖子一样,它应该是inline
,不,正如您所说,app.wsgi_app = DebuggedApplication(app.wsgi_app, True)
- 请注意您忘记了app.wsgi_app = DebuggedApplication(app)
第二arg(小问题,我认为)和更加有力地包装True
本身,而不是像你应该包装app
- 而后者误认为你确实看起来确实会导致你观察到的失控递归。