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
Title: urllib.parse.urlsplit() must not lowercase() IPv6 scope value
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.7, Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: asvetlov, r.david.murray, socketpair
Priority: normal Keywords: patch

Created on 2017-12-14 15:30 by socketpair, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 4867 merged socketpair, 2017-12-14 15:32
PR 4959 merged python-dev, 2017-12-21 12:16
Messages (7)
msg308306 - (view) Author: Марк Коренберг (socketpair) * Date: 2017-12-14 15:30
qwe = urlsplit('http://[FE80::822a:a8ff:fe49:470c%Тест]:1234/keys')
qwe.hostname will be 'fe80::822a:a8ff:fe49:470c%тест'

Which is wrong.

correct value is

'fe80::822a:a8ff:fe49:470c%Тест'

so, IP-address is lowercased and zone id does not.
msg308326 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2017-12-14 17:57
In quick search the only RFC reference to this I found was https://tools.ietf.org/id/draft-sweet-uri-zoneid-01.html, which doesn't match what you are requesting (not that urlsplit's current behavior matches that either).  

Do you have RFC references?
msg308328 - (view) Author: Марк Коренберг (socketpair) * Date: 2017-12-14 18:41
https://url.spec.whatwg.org/#host-representation -> Support for <zone_id> is intentionally omitted.

https://tools.ietf.org/html/rfc6874
msg308329 - (view) Author: Марк Коренберг (socketpair) * Date: 2017-12-14 18:43
Also this:

http://potaroo.net/ietf/idref/draft-kitamura-ipv6-zoneid-free/

So, I'm confused. Will investigate.
msg308870 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2017-12-21 12:54
New changeset fdb148f949e3ae66036b75163ff68042d19cf0fc by Andrew Svetlov (Miss Islington (bot)) in branch '3.6':
bpo-32323: urllib.parse.urlsplit() must not lowercase() IPv6 scope value (GH-4867) (#4959)
https://github.com/python/cpython/commit/fdb148f949e3ae66036b75163ff68042d19cf0fc
msg308871 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2017-12-21 12:58
RFC doesn't specify a case for Zone ID, let's keep it untouched (no lowercasing)
msg308886 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2017-12-21 17:19
I don't think a zone id in that form is actually valid in a URI, but I agree that not messing with whatever is there is probably the best policy as long as we aren't directly supporting whatever *is* valid.
History
Date User Action Args
2022-04-11 14:58:55adminsetgithub: 76504
2017-12-21 17:19:58r.david.murraysetmessages: + msg308886
2017-12-21 12:58:46asvetlovsetstatus: open -> closed
versions: - Python 3.8
messages: + msg308871

resolution: fixed
stage: patch review -> resolved
2017-12-21 12:54:47asvetlovsetnosy: + asvetlov
messages: + msg308870
2017-12-21 12:16:29python-devsetpull_requests: + pull_request4850
2017-12-14 18:43:31socketpairsetmessages: + msg308329
2017-12-14 18:41:19socketpairsetmessages: + msg308328
2017-12-14 17:57:38r.david.murraysetnosy: + r.david.murray
messages: + msg308326
2017-12-14 15:32:57socketpairsetkeywords: + patch
stage: patch review
pull_requests: + pull_request4758
2017-12-14 15:30:39socketpaircreate