Skip to content

IPv6Interface.ip loses scope ID information #129538

@relativityspace-jsmith

Description

@relativityspace-jsmith

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

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions