mirror of
https://github.com/python/cpython.git
synced 2025-08-28 12:45:07 +00:00
Fix SF # 591713, Fix "file:" URL to have right no. of /'s, by Bruce Atherton
Add a test too. urljoin() would make file:/tmp/foo instead of file:///tmp/foo Bugfix candidate, I will backport.
This commit is contained in:
parent
e134158f23
commit
7dfb6e295b
2 changed files with 6 additions and 1 deletions
|
@ -128,7 +128,7 @@ def urlunparse((scheme, netloc, url, params, query, fragment)):
|
|||
return urlunsplit((scheme, netloc, url, query, fragment))
|
||||
|
||||
def urlunsplit((scheme, netloc, url, query, fragment)):
|
||||
if netloc or (scheme in uses_netloc and url[:2] == '//'):
|
||||
if netloc or (scheme in uses_netloc and url[:2] != '//'):
|
||||
if url and url[:1] != '/': url = '/' + url
|
||||
url = '//' + (netloc or '') + url
|
||||
if scheme:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue