-
-
Notifications
You must be signed in to change notification settings - Fork 176
Closed
Labels
Description
Describe the bug
Input filtering for with_port #793 changed the logic to render the URL to compare the port to None.
94b8679#r116844287
as it is possible to create a URL with a port="" via URL.build, this results in urls created with an empty port.
To Reproduce
import yarl
u = yarl.URL.build(scheme="http", host="api.com", port="", path="/v1")
assert str(u) == "http://api.com/v1", str(u)
Expected behavior
Filtering port="" in URL.build.
I'd even prefer to allow "" and convert to None to stay backwards compatible.
Logs/tracebacks
AssertionError: http://api.com:/v1Python Version
$ python --version
Python 3.10.6multidict Version
$ python -m pip show multidict
Name: multidict
Version: 6.0.2yarl Version
$ python -m pip show yarl
Name: yarl
Version: 1.9.2OS
Linux
Additional context
No response
Code of Conduct
- I agree to follow the aio-libs Code of Conduct