Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnicodeDecodeError with SECRET_KEY not ascii #5

Closed
g1ra opened this issue Jul 31, 2013 · 1 comment
Closed

UnicodeDecodeError with SECRET_KEY not ascii #5

g1ra opened this issue Jul 31, 2013 · 1 comment

Comments

@g1ra
Copy link

g1ra commented Jul 31, 2013

Cannot handle special character.

For example:
SECRET_KEY = '\x91\x85K\xcek\xcc\xb9\x99[$)\xd9\xbc(\x96,\xb4\xcc\xdcGRC\xefz'

UnicodeDecodeError: 'ascii' codec can't decode byte 0x91 in position 0: ordinal not in range(128)
flask_login.py", line 542, in make_secure_token
key = key.encode('utf-8') # ensure bytes

@g1ra g1ra closed this as completed Jul 31, 2013
@g1ra
Copy link
Author

g1ra commented Jul 31, 2013

fix:
SECRET_KEY = u'\x91\x85K\xcek\xcc\xb9\x99[$)\xd9\xbc(\x96,\xb4\xcc\xdcGRC\xefz'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant