fix json.loads TypeError in python3