werkzeug: Werkzeug 0.11 with Flask 0.10.1 and 'app.debug = True' won't start.

I wrote the following test script to demonstrate the issue

import flask

app = flask.Flask(__name__)

@app.route("/")
def helloWorld():
        return "Hello world!"

app.debug = True
app.run()

Running it with Flask 0.10.1 and Werkzeug 0.11 raises this error

Traceback (most recent call last):
  File "flask-test", line 10, in <module>
    app.run()
  File "/usr/local/lib/python3.4/dist-packages/flask/app.py", line 772, in run
    run_simple(host, port, self, **options)
  File "/usr/local/lib/python3.4/dist-packages/werkzeug/serving.py", line 633, in run_simple
    application = DebuggedApplication(application, use_evalex)
  File "/usr/local/lib/python3.4/dist-packages/werkzeug/debug/__init__.py", line 169, in __init__
    if self.pin is None:
  File "/usr/local/lib/python3.4/dist-packages/werkzeug/debug/__init__.py", line 179, in _get_pin
    self._pin, self._pin_cookie = get_pin_and_cookie_name(self.app)
  File "/usr/local/lib/python3.4/dist-packages/werkzeug/debug/__init__.py", line 96, in get_pin_and_cookie_name
    h.update('cookiesalt')
TypeError: Unicode-objects must be encoded before hashing

If I downgrade Werkzeug to 0.10.4, it runs without a hitch. However, I can make this run with Werkzeug 0.11 if I remove the app.debug = True.

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 16 (3 by maintainers)

Commits related to this issue

Most upvoted comments

@jscholes We recently pushed a release that fixes an almost identical bug. Could you post the full traceback in a new issue? Thanks!