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: 'ascii' codec can't decode byte #215

Open
OlegZv opened this issue May 31, 2018 · 1 comment
Open

UnicodeDecodeError: 'ascii' codec can't decode byte #215

OlegZv opened this issue May 31, 2018 · 1 comment

Comments

@OlegZv
Copy link

OlegZv commented May 31, 2018

In Flask-User 1.0.1.4(python 2.7) when starting an app, Flask-User throws an error:

Traceback (most recent call last):
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2017.2.3\helpers\pydev\pydevd.py", line 1599, in <module>
    globals = debugger.run(setup['file'], None, None, is_module)
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2017.2.3\helpers\pydev\pydevd.py", line 1026, in run
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "C:/AutomatedTesting/run.py", line 1, in <module>
    from auto_device_testing import app
  File "C:/AutomatedTesting\auto_device_testing\__init__.py", line 11, in <module>
    from views import main
  File "C:/AutomatedTesting\auto_device_testing\views.py", line 10, in <module>
    user_manager = UserManager(app, db, User)
  File "C:\Users\ozvona413\AutomatedTesting\lib\site-packages\flask_user\user_manager.py", line 56, in __init__
    self.init_app(app, db, UserClass, **kwargs)
  File "C:\Users\ozvona413\AutomatedTesting\lib\site-packages\flask_user\user_manager.py", line 197, in init_app
    self.token_manager = TokenManager(app)
  File "C:\Users\ozvona413\AutomatedTesting\lib\site-packages\flask_user\token_manager.py", line 46, in __init__
    key = flask_secret_key.encode()
UnicodeDecodeError: 'ascii' codec can't decode byte 0x8c in position 2: ordinal not in range(128)

SEKRET_KEY="?A\x8c_\x0cX\xf2K%]J!i\x97\x84\xd2\xddb\x8d\x8a\xe7\x9b+\x1d"

Tried to change flask_secret_key.encode() to flask_secret_key.encode('utf-8') but it threw the save error.

@and-semakin
Copy link
Collaborator

Looks relevant to #229

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

2 participants