You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
IPv6Address.exploded does not support interface name (scope id) #88178
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=Nonecreated_at=<Date2021-05-02.21:47:15.478>labels= ['library']
title='IPv6Address.exploded does not support interface name (scope id)'updated_at=<Date2021-05-02.22:00:23.213>user='https://github.com/ohwgiles'
IPv6 addresses may contain a scope id, for example "fe80::1%eth0".
These are usually required for link-local addresses.
bpo-34788 added support for scoped IPv6 addresses, but missed the
"exploded" method:
>>> import ipaddress
>>> ipaddress.IPv6Address('fe80::1%eth0').exploded
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.9/ipaddress.py", line 394, in exploded
return self._explode_shorthand_ip_string()
File "/usr/lib/python3.9/ipaddress.py", line 1824, in _explode_shorthand_ip_string
ip_int = self._ip_int_from_string(ip_str)
File "/usr/lib/python3.9/ipaddress.py", line 1705, in _ip_int_from_string
raise AddressValueError("%s in %r" % (exc, ip_str)) from None
ipaddress.AddressValueError: Only hex digits permitted in '1%eth0' in 'fe80::1%eth0'
Activity
ohwgiles commentedon May 2, 2021
IPv6 addresses may contain a scope id, for example "fe80::1%eth0".
These are usually required for link-local addresses.
bpo-34788 added support for scoped IPv6 addresses, but missed the
"exploded" method:
malvidin commentedon Jun 15, 2022
Is it out of scope for this bug to add this check for additional invalid IPv6 Scope IDs?
cpython/Lib/ipaddress.py
Line 1859 in 99be1cb
Based on RFC4007, section 11.2, paragraph 5
https://datatracker.ietf.org/doc/html/rfc4007.html#section-11.2
NeevCohen commentedon Mar 4, 2024
I'd like to work on a fix for this. Is this issue still available?
gh-88178: Fix exploded IPv6 addresses with a scope ID (GH-25824)
[3.13] gh-88178: Fix exploded IPv6 addresses with a scope ID (GH-25824)…
[3.14] gh-88178: Fix exploded IPv6 addresses with a scope ID (GH-25824)…
pythongh-88178: Fix exploded IPv6 addresses with a scope ID (pythonGH…
[3.15] gh-88178: Fix exploded IPv6 addresses with a scope ID (GH-25824)…