-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Open
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
Hi, I ran into an issue in my code (in multiplemonomials/multicast_expert) because putting an IPv6 address into an IPv6Interface
, then accessing it via the ip
property loses the scope ID information.
Here's a minimal example:
>> addr = ipaddress.IPv6Address("fe80::%10")
>> addr
IPv6Address('fe80::%10')
>> addr_with_prefix = ipaddress.IPv6Interface((addr, 64))
>> addr_with_prefix
IPv6Interface('fe80::%10/64')
>> addr_with_prefix.ip
IPv6Address('fe80::')
I would expect the last line to return IPv6Address('fe80::%10')
, matching the value of addr
. Not 100.0% sure this is a bug, but it's certainly something I would not expect since it's not in the documentation. So I'd appreciate if a note about this could be added to the docs if nothing else! Thank you!
Note that this issue is similar, but not the same thing: #88178
CPython versions tested on:
3.11
Operating systems tested on:
Windows
Linked PRs
Metadata
Metadata
Assignees
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error