You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Confusing error messages when passing in the wrong URL type #1258
It is not a string, but also does not have a ._uri_reference field.
The resulting error we got, which was hard for us to debug was:
'URL' object has no attribute '_uri_reference'
Traceback (most recent call last):
...
File <redacted>, line 27, in <redacted>
async with AsyncClient(base_url=settings.service_baselink) as client:
File "<redacted>/lib/python3.7/site-packages/httpx/_client.py", line 1125, in __init__
trust_env=trust_env,
File "<redacted>/lib/python3.7/site-packages/httpx/_client.py", line 72, in __init__
self._base_url = self._enforce_trailing_slash(URL(base_url))
File "<redacted>/lib/python3.7/site-packages/httpx/_models.py", line 74, in __init__
self._uri_reference = url._uri_reference
AttributeError: 'URL' object has no attribute '_uri_reference'
I would suggest that this block be changed to have a further check on the appropriate expected types and then raise a type error rather than an attribute error here.
Activity