New submission from devkral <[email protected]>:
the scheme argument of urlsplit/urlparse is completely broken.
here two examples:
urlunsplit(urlsplit("httpbin.org", scheme="https://"))
'https://:httpbin.org'
urlunsplit(urlsplit("httpbin.org", scheme="https"))
'https:///httpbin.org'
Fix: change urlsplit logic like this:
...
url, scheme, _coerce_result = _coerce_args(url, scheme)
scheme = scheme.rstrip("://") # this removes ://
...
i = url.find('://') # harden against arbitrary :
if i > 0:
...
elif scheme:
netloc, url = _splitnetloc(url, 0) # if scheme is specified, netloc is
implied
sry too lazy to create a patch from this. Most probably are all python versions
affected but I checked only 2.7 and 3.7 .
----------
components: Library (Lib)
messages: 330884
nosy: devkral
priority: normal
severity: normal
status: open
title: urlsplit scheme argument broken
versions: Python 2.7, Python 3.7
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue35377>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com