【问题标题】:Flask DebuggedApplication causing runtime error on Google App EngineFlask DebuggedApplication 在 Google App Engine 上导致运行时错误
【发布时间】:2016-01-04 00:44:40
【问题描述】:

当我使用https://stackoverflow.com/a/13821624/3164117a 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

【问题讨论】:

    标签: python google-app-engine gae-python27


    【解决方案1】:

    正如你引用的帖子,它应该是app.wsgi_app = DebuggedApplication(app.wsgi_app, True)不是,正如你所说,app.wsgi_app = DebuggedApplication(app) - 请注意你忘记了True 2nd arg(小问题,我想想)更令人信服的是,你正在包装 app 本身,而不是你应该包装 app.wsgi_app - 你犯的后一个错误似乎确实可能导致失控递归你观察。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-07-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-06-21
      • 2012-11-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多