Skip to content

gh-161384: Fix IPv6Network.exploded with a scope ID - #162715

Merged
asvetlov merged 1 commit into
python:mainfrom
gatewaytofredom:opt/ipv6-explode-shorthand
Dec 3, 2026
Merged

asvetlov merged 1 commit into
python:mainfrom
gatewaytofredom:opt/ipv6-explode-shorthand

Conversation

@gatewaytofredom

Copy link
Copy Markdown
Contributor

Read _ip and _scope_id directly in _BaseV6._explode_shorthand_ip_string() instead of formatting to a string and re-parsing with _ip_int_from_string().

This fixes IPv6Network.exploded failing with AddressValueError when the network has a scope ID, and avoids the string round-trip (~2.9x faster on IPv6Address.exploded).

Add tests for scoped IPv6Network.exploded.

@python-cla-bot

python-cla-bot Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

@asvetlov asvetlov added needs backport to 3.14 bugs and security fixes needs backport to 3.15 bugs and security fixes labels Dec 3, 2026
@asvetlov
asvetlov merged commit 5639e5d into python:main Dec 3, 2026
66 checks passed
@miss-islington-app

Copy link
Copy Markdown

Thanks @gatewaytofredom for the PR, and @asvetlov for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15.
🐍🍒⛏🤖

@bedevere-app

bedevere-app Bot commented Dec 3, 2026

Copy link
Copy Markdown

GH-163091 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label Dec 3, 2026
@bedevere-app

bedevere-app Bot commented Dec 3, 2026

Copy link
Copy Markdown

GH-163092 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Dec 3, 2026
@asvetlov

asvetlov commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Thanks, @gatewaytofredom

asvetlov pushed a commit that referenced this pull request Dec 3, 2026
#163092)

gh-161384: Fix IPv6Network.exploded with a scope ID (GH-162715)
(cherry picked from commit 5639e5d)


gh-161384: Fix IPv6Network.exploded with scope ID and avoid string round-trip

Co-authored-by: gateway <gateway12@laindex.net>
asvetlov pushed a commit that referenced this pull request Dec 3, 2026
#163091)

gh-161384: Fix IPv6Network.exploded with a scope ID (GH-162715)
(cherry picked from commit 5639e5d)


gh-161384: Fix IPv6Network.exploded with scope ID and avoid string round-trip

Co-authored-by: gateway <gateway12@laindex.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants