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 in sqlalchemy_utils.types.encrypted #275

Closed
xrmx opened this issue Jun 23, 2017 · 3 comments
Closed

UnicodeDecodeError in sqlalchemy_utils.types.encrypted #275

xrmx opened this issue Jun 23, 2017 · 3 comments

Comments

@xrmx
Copy link
Contributor

xrmx commented Jun 23, 2017

With 0.32.14 and python 3.4 we hit this on superset (apache/superset#2600):

  File "/venv/lib/python3.4/site-packages/sqlalchemy_utils/types/encrypted.py", line 262, in process_result_value
    decrypted_value = self.engine.decrypt(value)
  File "/venv/lib/python3.4/site-packages/sqlalchemy_utils/types/encrypted.py", line 90, in decrypt
    decrypted = decrypted.decode('utf-8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf1 in position 2: invalid continuation byte

Any hint on what could be wrong?

@xrmx
Copy link
Contributor Author

xrmx commented Jun 23, 2017

Sorted out, the error is returned when the key used for decryption is wrong. Is it a correct interpretation? Do you think it makes sense to catch that and return something more explicit?

@kvesteri
Copy link
Owner

Yeah I think it makes sense to catch it and return something more explicit. @mehcode what do you think?

@mehcode
Copy link
Collaborator

mehcode commented Jun 28, 2017

I've gotten that error a dozen times and I've just penciled in bad key / access denied in my error memory.

I agree something that explicitly says that would be nice.

xrmx added a commit to xrmx/sqlalchemy-utils that referenced this issue Jun 29, 2017
xrmx added a commit to xrmx/sqlalchemy-utils that referenced this issue Aug 17, 2017
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

3 participants