[issue40938] urllib.parse.urlunsplit makes relative path to absolute (http:g -> http:///g)

Open Close report at bugs.python.org
Thu May 13 09:08:12 EDT 2021


Open Close <openandclose23 at gmail.com> added the comment:

'http:///g' has absolute path '/g',
and as urljoin shows:

    >>> urljoin('http://a/b/c/d', 'http:///g')
    'http://a/g'  # 'a' is netloc

So you are proposing third interpretation.

      "http:g"        =  "http:g"         ; for strict parsers
                      /  "http://a/b/c/g" ; for backward compatibility
                      /  "http://a/g"     ; (yours)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40938>
_______________________________________


More information about the Python-bugs-list mailing list