Closed as not planned
Closed as not planned
Description
Bug report
from urllib.parse import urlparse
malformed = urlparse("8.8.8.8:1337")._replace(scheme='http').geturl()
print(malformed)
This prints ''http:///8.8.8.8:1337", but should have printed "http://8.8.8.8:1337".
Note the three slashes.
The reason is that the urlunsplit function in Lib/urllib/parse.py checks whether the original url contains a slash, which is not the case, adds a slash and then adds two more slashes.
Your environment
- CPython versions tested on: 3.10.5