GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-151049: Add 2001:1::3/128 (RFC 9665) to ipaddress IPv6 global exceptions by tonghuaroot · Pull Request #151050 · python/cpython

Conversation

@tonghuaroot

@tonghuaroot tonghuaroot commented Jun 7, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

IANA's IPv6 Special-Purpose Address Registry (2024-04) lists 2001:1::3/128
("DNS-SD Service Registration Protocol Anycast", RFC 9665) with
Globally Reachable = True, like its neighbours 2001:1::1/128 (PCP, RFC 7723)
and 2001:1::2/128 (TURN, RFC 8155).

_IPv6Constants._private_networks_exceptions carved out ::1 and ::2
(added in GH-113179 for #113171) but never got ::3, so
ipaddress.ip_address('2001:1::3').is_global wrongly returns False.

This PR adds IPv6Network('2001:1::3/128') to the exceptions list, with an
RFC 9665 reference comment, and extends testReservedIpv6 to assert
2001:1::3 is global / not private and that the adjacent unregistered
2001:1::4 stays non-global (so the carve-out is exact). Adds a Misc/NEWS entry.

I cross-checked the whole IANA IPv6 registry against the exceptions list: every
other Globally-Reachable entry that sits inside a non-global parent block --
2001:1::1, 2001:1::2, 2001:3::/32, 2001:4:112::/48, 2001:20::/28,
2001:30::/28, all under 2001::/23 -- is already present, so 2001:1::3 is
the only one missing. The two Globally-Reachable blocks that are not inside a
private parent (64:ff9b::/96, 2620:4f:8000::/48) need no exception. The
exceptions list (and the ::1/::2 siblings) landed in GH-113179 and first
shipped in 3.13, so this applies to 3.13+.

Before:

>>> ipaddress.ip_address('2001:1::3').is_global
False

After:

>>> ipaddress.ip_address('2001:1::3').is_global
True
>>> ipaddress.ip_address('2001:1::4').is_global   # unregistered neighbour, unchanged
False
  • Issue: ipaddress: 2001:1::3/128 (RFC 9665) missing from IPv6 _private_networks_exceptions, is_global returns False #151049

AI Usage Statement

This contribution was made by the human contributor, who identified the issue
(the IANA 2024-04 2001:1::3/128 / RFC 9665 registration missing from CPython's
IPv6 exceptions table), reproduced it, designed the one-line fix to mirror the
existing ::1/::2 entries, wrote the test and the NEWS entry, and reviewed
and verified everything. An AI assistant helped with locating the relevant code,
cross-checking the IANA registry, and drafting text. Per the CPython policy that
disclosing AI assistance is appreciated, this is disclosed here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@tonghuaroot
pythongh-151049: Add 2001:1::3/128 (RFC 9665) to ipaddress IPv6 globa…
ec0c214
…l exceptions

IANA's IPv6 Special-Purpose Address Registry (2024-04) lists 2001:1::3/128
("DNS-SD Service Registration Protocol Anycast", RFC 9665) as globally
reachable, like 2001:1::1/128 and 2001:1::2/128. It was missing from
_IPv6Constants._private_networks_exceptions, so is_global returned False
for it. Add the exception and extend testReservedIpv6.
@bedevere-app bedevere-app Bot added the awaiting review label Jun 7, 2026
@bedevere-app bedevere-app Bot mentioned this pull request Jun 7, 2026
ipaddress: 2001:1::3/128 (RFC 9665) missing from IPv6 _private_networks_exceptions, is_global returns False #151049
Closed
vstinner
vstinner approved these changes Jun 8, 2026
View reviewed changes

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGTM.

ipaddress _private_networks table refers to https://www.iana.org/assignments/iana-ipv6-special-registry/iana-ipv6-special-registry.xhtml which contains 2001:1::3/128: allocated in 2024-04 and refer to RFC 9665.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels Jun 8, 2026
@mjbommar mjbommar mentioned this pull request Jun 19, 2026
ipaddress: Two more IPv6 ranges (RFC 9602, 9780) missing from _private_networks #151749
Open
@tonghuaroot

tonghuaroot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor Author

Gentle ping — this has been approved (thanks @vstinner) and has carried the awaiting merge label since Jun 8. Anything else needed from my side before it can land? Happy to rebase if it has gone stale.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tonghuaroot tonghuaroot mentioned this pull request Jun 20, 2026
gh-151749: Add 5f00::/16 (RFC 9602) and 100:0:0:1::/64 (RFC 9780) to ipaddress IPv6 private networks #151764
Open
@vstinner

vstinner commented Jun 22, 2026

Copy link
Copy Markdown
Member

@serhiy-storchaka: Would you mind reviewing this fix?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Sep 22, 2026

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Sep 22, 2026
@vstinner
vstinner merged commit 6757482 into python:main Sep 22, 2026
58 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting merge label Sep 22, 2026
@vstinner

vstinner commented Sep 22, 2026

Copy link
Copy Markdown
Member

I merged your change, thanks for your contribution. I'm sorry, I'm not used to ipaddress anymore, so I don't feel confident to backport the change to stable branches. I would need the support of a second core developer to backport the change.

tonghuaroot reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@vstinner vstinner vstinner approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

stale Stale PR or inactive for long period of time.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@tonghuaroot @vstinner
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.