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

decoding response content so it can be json loaded in python 3 without simplejson #63

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

i-yang
Copy link

@i-yang i-yang commented Apr 24, 2017

In Python 3, without simplejson, a successful api_post call returns the following exception:
TypeError: the JSON object must be str, not 'bytes'. The reason seems to be that response.content is a bytes literal, which need to be decoded before being passed in to json.loads.

simplejson.loads seems to handle byte literals, but unfortunately, simplejson conflicts with some of the other third party libraries we're using.

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

Successfully merging this pull request may close these issues.

1 participant