[issue39799] Never return base's fragment from urljoin (urllib.parse)

Open Close report at bugs.python.org
Sat Feb 29 10:04:08 EST 2020


New submission from Open Close <openandclose23 at gmail.com>:

According to RFC3986 5.2.2.,
target fragment is always reference fragment
(T.fragment = R.fragment;).

This is different from RFC1808 (4. and 5.2.).
And it is not mentioned
in Modifications section in RFC2396 and RFC3986.

Current:
>>> import urllib.parse
>>> urllib.parse.urljoin('http://a/b#f', '')
'http://a/b#f'

Should return:
'http://a/b'

---

https://tools.ietf.org/html/rfc3986#section-5.2.2
https://tools.ietf.org/html/rfc1808.html#section-4
https://tools.ietf.org/html/rfc1808.html#section-5.2

----------
components: Library (Lib)
messages: 362983
nosy: op368
priority: normal
severity: normal
status: open
title: Never return base's fragment from urljoin (urllib.parse)
type: behavior
versions: Python 3.9

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


More information about the Python-bugs-list mailing list