Skip to content

Commit 0744a66

Browse files
Update Misc/NEWS.d/next/Library/2025-02-01-13-01-12.gh-issue-129538.A9ERy9.rst
Update: Reduce lines in **News.d** Co-authored-by: Semyon Moroz <[email protected]>
1 parent 5bdf7c2 commit 0744a66

File tree

1 file changed

+2
-21
lines changed

1 file changed

+2
-21
lines changed
Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,2 @@
1-
This pull request addresses the issue described in `issue #129538 <https://github.com/python/cpython/issues/129538>`_, where the ``IPv6Interface.ip`` loses the scope ID information when accessing the IP address.
2-
3-
The problem occurs when an IPv6 address with a scope ID is converted into an ``IPv6Interface`` and then accessed via the ``ip`` property, resulting in the loss of the scope ID information. This behavior is unexpected and not documented.
4-
5-
Minimal Example Demonstrating the Issue::
6-
7-
addr = ipaddress.IPv6Address("fe80::%10")
8-
addr_with_prefix = ipaddress.IPv6Interface((addr, 64))
9-
print(addr_with_prefix.ip) # Expected: IPv6Address('fe80::%10'), Actual: IPv6Address('fe80::')
10-
11-
Changes Made:
12-
1. Fix in ``IPv6Interface`` Class:
13-
- Updated the ``IPv6Interface`` class to ensure the scope ID is preserved when converting the IP address.
14-
- Modified the ``ip`` property to include the scope ID in the address string.
15-
16-
2. Added Test Case:
17-
- Added a test case to verify that the scope ID is preserved when converting the IP address in the ``IPv6Interface`` class.
18-
19-
Tests and Documentation:
20-
- Updated the tests in ``Lib/test/test_ipaddress.py`` to include the new test case.
21-
- No changes to documentation as the behavior is expected and intuitive.
1+
Ensure that scope ID is preserved when converting the IP address in
2+
:class:`ipaddress.IPv6Interface`. Patch by John Kagunda.

0 commit comments

Comments
 (0)