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).
json.loads()
supports an argument of typebytes
orbytearray
in Python 3.6+. In older Python versions the function only accepts an argument of typestr
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
).