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 steven.daprano
Recipients SilentGhost, devkral, orsenthil, steven.daprano
Date 2018-12-03.00:26:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1543796785.64.0.788709270274.issue35377@psf.upfronthosting.co.za>
In-reply-to
Content
I don't think this is broken, but I do think it could be documented better. You have to read the documentation for `urlparse` to see this:

[Quote]
Following the syntax specifications in RFC 1808, urlparse recognizes a netloc only if it is properly introduced by ‘//’. Otherwise the input is presumed to be a relative URL and thus to start with a path component.

https://docs.python.org/3/library/urllib.parse.html#urllib.parse.urlparse

so the function is correct. You're making two errors:

- providing a relative URL "httpbin.org" and expecting it to be treated as an absolute URL;

- specifying scheme+delimiter instead of the scheme alone.

So I don't think this is a bug. urlsplit rightly accepts any arbitrary string as a scheme (it used to have a whitelist of permitted schemes, and that was a problem), and we can't assume that :/// is ONLY valid for file protocols.

Unless you come up with a convincing argument for why this is a bug, I'm going to change it to a documentation issue. The docs could do with some improvement to make it more clear, although the examples are good.
History
Date User Action Args
2018-12-03 00:26:25steven.dapranosetrecipients: + steven.daprano, orsenthil, SilentGhost, devkral
2018-12-03 00:26:25steven.dapranosetmessageid: <1543796785.64.0.788709270274.issue35377@psf.upfronthosting.co.za>
2018-12-03 00:26:25steven.dapranolinkissue35377 messages
2018-12-03 00:26:25steven.dapranocreate