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 on python 2.7 / django 1.11 #129

Open
freddez opened this issue Nov 21, 2018 · 2 comments
Open

UnicodeDecodeError on python 2.7 / django 1.11 #129

freddez opened this issue Nov 21, 2018 · 2 comments

Comments

@freddez
Copy link

freddez commented Nov 21, 2018

On last 1.15 version with python 2.7, response data is utf-8 encoded and causes a UnicodeError in bas_mixins.py:63 :

ipdb> data
'{"non_field_errors":["Une demande \xc3\xa0 traiter de ce type existe d\xc3\xa9j\xc3\xa0 sur cette famille."]}'
ipdb> type(data)
<type 'str'>
ipdb> print data
{"non_field_errors":["Une demande à traiter de ce type existe déjà sur cette famille."]}

I think you should add the utf-8 encoding parameter, at least in python2 :

ipdb> print data.decode('utf-8')
u'{"non_field_errors":["Une demande à traiter de ce type existe déjà sur cette famille."]}'
@avelis
Copy link
Collaborator

avelis commented Nov 21, 2018

@freddez If you can make a PR with this check I would be happy to take a look and potentially merge.

@rrauenza
Copy link

Just hit this today. Wish I could just turn off response logging/parsing. Thanks for the fix. I look forward to the release...

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