Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-44012: IPv6Address.exploded with scope_id #25824

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ohwgiles
Copy link

@ohwgiles ohwgiles commented May 2, 2021

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'

https://bugs.python.org/issue44012

@github-actions
Copy link

github-actions bot commented Jun 3, 2021

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale Stale PR or inactive for long period of time. label Jun 3, 2021
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'
Copy link
Contributor

@MaxwellDupre MaxwellDupre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good to go.

@github-actions github-actions bot removed the stale Stale PR or inactive for long period of time. label Aug 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants