fastly / fastly-py

A Fastly API client for Python
https://pypi.org/project/fastly/
MIT License
77 stars 59 forks source link

Fix json.loads() error with Python < 3.6 #46

Closed davidebeatrici closed 4 years ago

davidebeatrici commented 5 years ago

json.loads() supports an argument of type bytes or bytearray in Python 3.6+. In older Python versions the function only accepts an argument of type str and the current code causes an error: the JSON object must be str, not 'bytes'.

This commit fixes the issue by explicitly decoding from UTF-8 (changing the type to str).

davidebeatrici commented 4 years ago

You're welcome.