Martin Panter added the comment:

The current behaviour when no scheme is present is fairly sensible to me and 
should not be changed to do string concatenation nor raise an exception:

>>> urljoin("//netloc/old/path", "new/path")
'//netloc/old/new/path'

I am posting urljoin-non-hier.patch as an alternative to my first patch. This 
one changes urljoin() to work on any URL scheme not in the existing 
“non_hierarchical” blacklist. I removed the gopher, wais, and imap schemes from 
the list, and added tel, so that urljoin() continues to treat these special 
cases as before. Out of the schemes mentioned in the module but missing from 
uses_relative, I think non_hierarchical now has all those without directory 
components: hdl, mailto, news, sip, sips, snews, tel, telnet.

However I am still not really convinced that my first urljoin-scheme.patch is a 
bad idea. Do people actually use urljoin() with these schemes like mailto in 
the first place?

----------
Added file: http://bugs.python.org/file38698/urljoin-non-hier.patch

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

Reply via email to