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
When building a URL using yarl.URL.build() the command will fail with exception:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/path/to/virtualenv/lib/python3.10/site-packages/yarl/_url.py", line 248, in build
cls._validate_authority_uri_abs_path(host=host, path=path)
File "/path/to/virtualenv/lib/python3.10/site-packages/yarl/_url.py", line 706, in _validate_authority_uri_abs_path
if len(host) > 0 and len(path) > 0 and not path.startswith("/"):
TypeError: object of type 'NoneType' has no len()
Either passing without problems or some meaningful error/exception indicating that host cannot be None.
Logs/tracebacks
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/path/to/virtualenv/lib/python3.10/site-packages/yarl/_url.py", line 248, in buildcls._validate_authority_uri_abs_path(host=host, path=path)
File "/path/to/virtualenv/lib/python3.10/site-packages/yarl/_url.py", line 706, in _validate_authority_uri_abs_pathiflen(host) >0andlen(path) >0andnot path.startswith("/"):
TypeError: object of type 'NoneType' has no len()
Describe the bug
When building a URL using
yarl.URL.build()
the command will fail with exception:To Reproduce
yarl
version1.8.2
Expected behavior
Either passing without problems or some meaningful error/exception indicating that
host
cannot beNone
.Logs/tracebacks
Python Version
multidict Version
yarl Version
OS
Ubuntu 22.04
Additional context
This should be easy to fix by simply adding the same check for
host
as those forscheme
,authority
, etc, in the condition here.Code of Conduct
The text was updated successfully, but these errors were encountered: