➜

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
标题: urllib.parse doesn't fully comply to RFC 3986
类型: behavior Stage:
Components: Library (Lib) Versions: Python 3.8, Python 3.7, Python 3.6
process
状态: open Resolution:
Dependencies: 后续:
分配给: 抄送列表: Howie Benefiel, Ivan.Pozdeev, Jeffrey.Kintscher, RJ722, The Compiler, orsenthil, xtreak
优先级: normal 关键字:

The Compiler 于 2018-08-08 16:02 创建。最近一次由 admin 于 2022-04-11 14:59 修改。

Messages (2)
msg323292 - (view) Author: Florian Bruhin (The Compiler) * 日期: 2018-08-08 16:02
Since bpo-29651, the urllib.parse docs say:

> Unmatched square brackets in the netloc attribute will raise a ValueError.

However, when there are at least one [ and ], but they don't match, there's somewhat inconsistent behavior:

>>> urllib.parse.urlparse('http://[::1]]').hostname
'::1'
>>> urllib.parse.urlparse('http://[[::1]').hostname
'[::1'
msg323362 - (view) Author: Ivan Pozdeev (Ivan.Pozdeev) * 日期: 2018-08-10 09:28
I confirm violation of https://tools.ietf.org/html/rfc3986#section-3.2.2 . 

URLs are now covered by RFC 3986 which obsoletes RFC 1808 that `urllib's documentation refers to.

This new URL RFC adds [] to 'reserved' characters, so them being present unquoted anywhere where reserved characters are not allowed shall be a parsing error.
历史
日期 用户 动作 参数
2022-04-11 14:59:04admin修改github: 78541
2020-08-07 06:49:54Jeffrey.Kintscher修改抄送: + Jeffrey.Kintscher
2020-06-29 17:13:36RJ722修改抄送: + RJ722
2018-08-10 09:28:00Ivan.Pozdeev修改versions: + Python 3.6, Python 3.7, Python 3.8
抄送: + Ivan.Pozdeev
标题: urllib.parse doesn't fail with multiple unmatching square brackets -> urllib.parse doesn't fully comply to RFC 3986
消息: + msg323362

2018-08-09 07:45:55xtreak修改抄送: + xtreak
2018-08-08 16:02:35The Compiler创建