If I input a URL of the form <scheme>:<integer> then neither function splits off the scheme correctly depending on the scheme being used. If I alter <integer> by adding a non-digit character this works as expected. (I'm on python 3.8.8)
>>> from urllib.parse import urlparse
>>> urlparse("custom:12345") # does not work
ParseResult(scheme='', netloc='', path='custom:12345', params='', query='', fragment='')
>>> urlparse("zip:12345") # does not work
ParseResult(scheme='', netloc='', path='zip:12345', params='', query='', fragment='')
urlparse("custom:12345d") # this works as expected
ParseResult(scheme='custom', netloc='', path='12345d', params='', query='', fragment='')
>>> urlparse("custom:12345.") # so does this
ParseResult(scheme='custom', netloc='', path='12345.', params='', query='', fragment='')
>>> urlparse("http:12345") # for some reason this works (!?)
ParseResult(scheme='http', netloc='', path='12345', params='', query='', fragment='')
>>> urlparse("https:12345") # yet this does not
ParseResult(scheme='', netloc='', path='https:12345', params='', query='', fragment='')
>>> urlparse("ftp:12345") # no luck here neither
ParseResult(scheme='', netloc='', path='ftp:12345', params='', query='', fragment='')
According to Wikipedia, a URI requires a scheme. Empty schemes schould correspond to URI references, which should only treat <scheme>:<number> as a schema-less (relative) path containing a colon if it is preceded by ./.
So why does this break in the way demonstrated above? What I would have expected is that all the cases above split the URI/URL into a <scheme>:<number> where <number> is the path.