Skip to content

Conversation

@tomwijnroks
Copy link
Contributor

On systems with Python 3.5.3 (Debian 9) the Parser fails to decode the content:

  File "/usr/local/lib/python3.5/dist-packages/exonetapi/result/Parser.py", line 17, in __init__
    self.__json = json.loads(self.__data)
  File "/usr/lib/python3.5/json/__init__.py", line 312, in loads
    s.__class__.__name__))
TypeError: the JSON object must be str, not 'bytes'

Adding .decode() fixes this. I tested this change with Python 3.5.3 and Python 3.7.3.

It has been fixed since Python 3.6

@robbinjanssen robbinjanssen added the bugfix Inconsistencies or issues which will cause a problem for users or implementors. label Nov 8, 2021
@robbinjanssen robbinjanssen changed the title Decode json content Decode JSON content when parsing API results Nov 8, 2021
@trizz trizz self-assigned this Nov 8, 2021
@trizz trizz merged commit 4f4d551 into master Nov 8, 2021
@trizz trizz deleted the parser-decode branch November 8, 2021 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Inconsistencies or issues which will cause a problem for users or implementors.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants