forked from kjkjava/garmin-connect-export
-
Notifications
You must be signed in to change notification settings - Fork 21
Closed
Description
After using python3 gcexport3.py and logging in I get the error 'TypeError: the JSON object must be str, not 'bytes''
I have solved this issue by detecting the encoding :
Instead of LIST = json.loads(ACTIVITY_LIST) use:
LIST = json.loads(ACTIVITY_LIST.decode(chardet.detect(ACTIVITY_LIST)["encoding"]))
and instead of #JSON_SUMMARY = json.loads(ACTIVITY_SUMMARY) use:
JSON_SUMMARY = json.loads(ACTIVITY_SUMMARY.decode(chardet.detect(ACTIVITY_SUMMARY)["encoding"]))
you have to install and use the module chardet:
pip3 install chardet
add 'import chardet' to gcexport3.py
Metadata
Metadata
Assignees
Labels
No labels