Martin Panter added the comment:

See also Issue 16134 for adding RTMP schemes to the registry. However, I wonder 
if it is time for a more general fix, rather than having an arms race with 
whatever URL scheme someone dreams up next.

According to Issue 7904, urlsplit() etc intentially support parsing the 
//netloc part for arbitrary URL schemes. However when putting it back together, 
the urlunsplit() etc functions currently cannot assume it is okay to insert an 
empty netloc “//”, probably because it would break URLs like tel:+1234 or 
mailto:someb...@example.net.

There are a bunch of URL-parsing issues floating around which may be able to 
come together to solve each other:

* Issue 8339: Round trip stripping empty netloc, apparently closed because the 
URLs were thought to be invalid (thought I disagree)
* Issue 15009: Round trip strips empty netloc for yelp:///foo
* Issue 23505: Round trip stripping netloc considered a security issue
* Issue 5843: Round trip stripping empty query and fragment strings
* Issue 22852: Round trip strips empty fragment

In Issue 22852, I proposed adding a series of has_netloc/query/fragment flags 
to the SplitResult etc classes. If that was implemented, we would not have to 
worry about whitelisting “scgi:” or other schemes in “uses_netloc”. Instead, 
urlsplit() would automatically set SplitResult(has_netloc=True), and 
urlunsplit() would know to restore the empty “//” netloc string.

----------
nosy: +vadmium

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue23636>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to