This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author devkral
Recipients devkral
Date 2018-12-02.15:27:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1543764457.53.0.788709270274.issue35377@psf.upfronthosting.co.za>
In-reply-to
Content
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 .
History
Date User Action Args
2018-12-02 15:27:37devkralsetrecipients: + devkral
2018-12-02 15:27:37devkralsetmessageid: <1543764457.53.0.788709270274.issue35377@psf.upfronthosting.co.za>
2018-12-02 15:27:37devkrallinkissue35377 messages
2018-12-02 15:27:37devkralcreate