Why does URL.build has this check:
|
if not host and scheme: |
|
raise ValueError('Can\'t build URL with "scheme" but without "host".') |
From my perspective, URL with a scheme and without a host is valid:
In [12]: u = URL("scheme://")
In [13]: u.scheme, u.host
Out[13]: ('scheme', None)
In [14]: URL.build(scheme=u.scheme, host=u.host)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-14-c54f9b7a765d> in <module>
----> 1 URL.build(scheme=u.scheme, host=u.host)
...
200
201 if not host and scheme:
--> 202 raise ValueError('Can\'t build URL with "scheme" but without "host".')
203 if port and not host:
204 raise ValueError('Can\'t build URL with "port" but without "host".')
ValueError: Can't build URL with "scheme" but without "host".
Why does
URL.buildhas this check:yarl/yarl/__init__.py
Lines 201 to 202 in 5ef628f
From my perspective, URL with a scheme and without a host is valid: