Flask Login: TypeError: decoding Unicode is not supported

不问归期 提交于 2019-12-03 12:26:59

The problem won't be solved by downgrading flask alone, because even installing flask==0.9 would install the latest dependencies, which is the bad werkzeug==0.9 Hence you better install the following in this order:

pip install werkzeug==0.8.3
pip install flask==0.9
pip install Flask-Login==0.1.3

flask login, can then be the latest version 0.1.3. No harm done there. This stack works for me.

Hope this helps, until the emergency patch is out.

I am having the very same problem on my dev environment, with Flask 0.10 and Flask-Login 0.1.3

looks like flask 0.10 now has unicode request headers so flask-login explodes when trying to encode an already encoded string...

Flask_login people are already working on it: https://github.com/maxcountryman/flask-login/issues/78

(EDIT) instant road to temporary happiness (as seen in github twin thread, thx Kofalt & Kave!)

pip uninstall flask ; pip uninstall werkzeug ; pip uninstall Flask-Login ; pip install werkzeug==0.8.3 ; pip install flask==0.9 ; pip install Flask-Login==0.1.3

My fork which fixes this issue:

https://github.com/jgelens/flask-login/tree/0.1.4

Install using:

pip install https://github.com/jgelens/flask-login/archive/0f07b8fa783c40d09cb284d442a526f067bab28b.zip#egg=flask-login
marcoseu

As per losu S., this looks to be a Flask 0.10 problem. Try to install previous version of Flask in your virtual environment using:

pip install Flask==0.9
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!