Closed
Description
Subject
I parse an IP address with port to get a url, but ParseResult
does not look right.
Environment
Describe your environment.
At least, paste here the output of:
OS Linux-5.10.0-17-amd64-x86_64-with-glibc2.31
>>> print("Python", platform.python_version())
Python 3.9.2
Steps to Reproduce
from urllib.parse import urlparse
urlparse('192.168.1.132:16992')
Expected Behavior
ParseResult(scheme='', netloc='192.168.1.132:16992', path='', params='', query='', fragment='')
Actual Behavior
ParseResult(scheme='192.168.1.132', netloc='', path='16992', params='', query='', fragment='')
I guess scheme should not be an IP address
This issue seems to be related: #38644