Commit 3902135
committed
bpo-44012: IPv6Address.exploded with scope_id
Support for scoped IPv6 addresses was implemented in bpo-34788
but missed implementing 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'
After this commit:
>>> import ipaddress
>>> ipaddress.IPv6Address('fe80::1%eth0').exploded
'fe80:0000:0000:0000:0000:0000:0000:0001%eth0'1 parent 5fb06ed commit 3902135
3 files changed
Lines changed: 7 additions & 7 deletions
File tree
- Lib
- test
- Misc/NEWS.d/next/Library
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1812 | 1812 | | |
1813 | 1813 | | |
1814 | 1814 | | |
1815 | | - | |
1816 | | - | |
1817 | | - | |
1818 | 1815 | | |
1819 | 1816 | | |
1820 | 1817 | | |
| |||
1824 | 1821 | | |
1825 | 1822 | | |
1826 | 1823 | | |
1827 | | - | |
| 1824 | + | |
1828 | 1825 | | |
1829 | 1826 | | |
1830 | 1827 | | |
1831 | | - | |
| 1828 | + | |
1832 | 1829 | | |
1833 | | - | |
1834 | | - | |
| 1830 | + | |
| 1831 | + | |
1835 | 1832 | | |
1836 | 1833 | | |
1837 | 1834 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2454 | 2454 | | |
2455 | 2455 | | |
2456 | 2456 | | |
| 2457 | + | |
| 2458 | + | |
2457 | 2459 | | |
2458 | 2460 | | |
2459 | 2461 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
0 commit comments