mirror of
https://github.com/python/cpython.git
synced 2025-08-29 13:15:11 +00:00
bpo-32323: urllib.parse.urlsplit() must not lowercase() IPv6 scope value (#4867)
This commit is contained in:
parent
a8d25a1645
commit
fbd605151f
3 changed files with 17 additions and 4 deletions
|
@ -155,10 +155,12 @@ class _NetlocResultMixinBase(object):
|
|||
def hostname(self):
|
||||
hostname = self._hostinfo[0]
|
||||
if not hostname:
|
||||
hostname = None
|
||||
elif hostname is not None:
|
||||
hostname = hostname.lower()
|
||||
return hostname
|
||||
return None
|
||||
# Scoped IPv6 address may have zone info, which must not be lowercased
|
||||
# like http://[fe80::822a:a8ff:fe49:470c%tESt]:1234/keys
|
||||
separator = '%' if isinstance(hostname, str) else b'%'
|
||||
hostname, percent, zone = hostname.partition(separator)
|
||||
return hostname.lower() + percent + zone
|
||||
|
||||
@property
|
||||
def port(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue