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
Thus, a URL like a://:1 conforms to the standard.
However, yarl rejects this URL.
urllib3, CPython urllib, rfc3986, furl, and hyperlink all correctly handle this situation.
To Reproduce
Try running the following snippet:
>>>yarl.URL("a://:1")
Expected behavior
The parse should have succeeded, resulting in URL('a://:1').
Logs/tracebacks
This is the output from the snippet:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.10/site-packages/yarl/_url.py", line 163, in __new__raiseValueError("Invalid URL: host is required for absolute urls")
ValueError: Invalid URL: host is required for absolute urls
### Python Version
```console
$ python --version
Python 3.10.9
multidict Version
$ python -m pip show multidictName: multidictVersion: 6.0.4Summary: multidict implementationHome-page: https://github.com/aio-libs/multidictAuthor: Andrew SvetlovAuthor-email: andrew.svetlov@gmail.comLicense: Apache 2Location: /home/bkallus/fuzzing/url_differential_fuzzing/url_fuzz_env/lib/python3.10/site-packagesRequires:Required-by: yarl
yarl Version
$ python -m pip show yarlName: yarlVersion: 1.8.2Summary: Yet another URL libraryHome-page: https://github.com/aio-libs/yarl/Author: Andrew SvetlovAuthor-email: andrew.svetlov@gmail.comLicense: Apache-2.0Location: /home/bkallus/fuzzing/url_differential_fuzzing/url_fuzz_env/lib/python3.10/site-packagesRequires: idna, multidictRequired-by:
OS
Arch Linux
Additional context
No response
Code of Conduct
I agree to follow the aio-libs Code of Conduct
The text was updated successfully, but these errors were encountered:
Describe the bug
Absolute URLs are permitted to have empty hosts in RFC 3986.
Relevant grammar rules:
Thus, a URL like
a://:1
conforms to the standard.However, yarl rejects this URL.
urllib3
, CPythonurllib
,rfc3986
,furl
, andhyperlink
all correctly handle this situation.To Reproduce
Try running the following snippet:
Expected behavior
The parse should have succeeded, resulting in
URL('a://:1')
.Logs/tracebacks
multidict Version
yarl Version
OS
Arch Linux
Additional context
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: