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 martin.panter
Recipients madison.may, martin.panter, mher, orsenthil
Date 2013-08-30.06:08:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1377842899.55.0.747295284631.issue18828@psf.upfronthosting.co.za>
In-reply-to
Content
Similarly, I expected this to return "rtmp://host/app?auth=token":

urljoin("rtmp://host/app", "?auth=token")

I'm not sure adding everybody's custom scheme to a hard-coded whitelist is the best way to do solve this.

Below I have identified some other schemes not in the "uses_relative" list. Is there any reason why one would use urljoin() with them, but want the base URL to be ignored (as is the current behaviour)? I looked at test_urlparse.py and there doesn't seem to be any test cases for these schemes.

>>> all = set().union(uses_relative, uses_netloc, uses_params, non_hierarchical, uses_query, uses_fragment)
>>> sorted(all.difference(uses_relative))
['git', 'git+ssh', 'hdl', 'mailto', 'news', 'nfs', 'rsync', 'sip', 'sips', 'snews', 'tel', 'telnet']

Even if the behaviour can't be changed, could the documentation for urljoin() say something like this:

Only the following [uses_relative] schemes are allowed in the base URL; any other schemes result in the relative URL being returned without being joined to the base.
History
Date User Action Args
2013-08-30 06:08:19martin.pantersetrecipients: + martin.panter, orsenthil, mher, madison.may
2013-08-30 06:08:19martin.pantersetmessageid: <1377842899.55.0.747295284631.issue18828@psf.upfronthosting.co.za>
2013-08-30 06:08:19martin.panterlinkissue18828 messages
2013-08-30 06:08:19martin.pantercreate