Я пытаюсь получить URL в формате json в файл json. Я получаю ошибку TypeError: Object of type bytes is not JSON serializable
password_mgr = urllib.request.HTTPPasswordMgrWithDefaultRealm()
uid = "usr" ##### enter UserId
pwd = "pass" ######## enter Password
url = 'url' +GLOBAL_DATE
password_mgr.add_password(None, url, uid, pwd)
handler = urllib.request.HTTPBasicAuthHandler(password_mgr)
opener = urllib.request.build_opener(handler)
opener.open(url)
urllib.request.install_opener(opener)
req = urllib.request.Request(url)
response = urllib.request.urlopen(req)
data = response.read()
with open('C:\\drive\\' + cDate1 + '\\data.json', 'w') as f:
json.dump(data,f)
любая помощь будет оценена.