req.add_header('Authorization', 'Basic %s' % auth_encoded)
try:
    response = urllib.request.urlopen(req)
except urllib.error.HTTPError as http_e:
    pass
Read https url from Python with basic access authentication