Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ipaddress.IPv6Address.is_loopback broken for IPv4-mapped addresses #117566

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

Description

@paravoid

Bug report

Bug description:

While properties likeis_private account for IPv4-mapped IPv6 addresses, such as for example:

>>>ipaddress.ip_address("192.168.0.1").is_privateTrue>>>ipaddress.ip_address("::ffff:192.168.0.1").is_privateTrue

...the same doesn't currently apply to theis_loopback property:

>>>ipaddress.ip_address("127.0.0.1").is_loopbackTrue>>>ipaddress.ip_address("::ffff:127.0.0.1").is_loopbackFalse

At minimum, this inconsistency between different properties is counter-intuitive. Moreover,::ffff:127.0.0.0/104 is for all intents and purposes a loopback address, and should be treated as such.

For the record, this will now match the behavior of other languages such as Rust, Go and .NET, cf.rust-lang/rust#69772.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

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


      [8]ページ先頭

      ©2009-2025 Movatter.jp