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

gh-87799: Improve the textual representation of IPv4-mapped IPv6 addresses#29345

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
asvetlov merged 13 commits intopython:mainfromopavlyuk:fix-issue-43633
Jul 31, 2023

Conversation

@opavlyuk
Copy link
Contributor

@opavlyukopavlyuk commentedOct 31, 2021
edited by bedevere-bot
Loading

maxmouchet, ykvch, and arhadthedev reacted with thumbs up emoji
@opavlyuk
Copy link
ContributorAuthor

@maxmouchet,@ykvch guys, please take a look on this PR when you get a chance.
I'll greatly appreciate initial review, before someone from core developers gets here.

maxmouchet reacted with thumbs up emoji

@maxmouchet
Copy link

maxmouchet commentedNov 9, 2021
edited
Loading

Thanks for tackling this! This looks good to me.

Maybe the__str__ method could be simplified a little as I think (need to find a source) that an IPv4-mapped IPv6 address will never have a scope identifier.

@opavlyuk
Copy link
ContributorAuthor

opavlyuk commentedNov 10, 2021
edited
Loading

Maybe the__str__ method could be simplified a little as I think (need to find a source) that an IPv4-mapped IPv6 address will never have a scope identifier.

Thanks! Lets discuss it.
Indeed, according toRFC 4007 Section 11.1, IPv6 address 'scoped' format is meaningless and should not be used for global addresses.
At the same time,

This document, however, does not prohibit an implementation from using the format for those special addresses for implementation dependent purposes.

In addition,RFC 4007 Section 4 says that

[1] defines IPv6 addresses with embedded IPv4 addresses as being part
of global addresses. Thus, those addresses have global scope, with
regard to the IPv6 scoped address architecture. However, an
implementation may use those addresses as if they had other scopes
for convenience. For instance, [6] assigns link-local scope to IPv4
auto-configured link-local addresses (the addresses from the prefix
169.254.0.0/16 [7]) and converts those addresses into IPv4-mapped
IPv6 addresses in order to perform destination address selection
among IPv4 and IPv6 addresses. This would implicitly mean that the
IPv4-mapped IPv6 addresses equivalent to the IPv4 auto-configuration
link-local addresses have link-local scope. This document does not
preclude such a usage, as long as it is limited within the
implementation.

That is all I managed to find regarding the subject.

Please, let me know what you think about it.

@opavlyuk
Copy link
ContributorAuthor

opavlyuk commentedNov 10, 2021
edited
Loading

Noticed, thatipaddress.IPv6Address.exploded behavior differs from expected after the patch:

>>> addr = IPv6Address('::ffff:8.8.4.4')# Expected>>> addr.exploded'0000:0000:0000:0000:0000:ffff:8.8.4.4'# Actual>>> addr.exploded'0000:0000:0000:0000:0000:ffff:0808:0404'

I'm in progress fixing that.

@github-actions
Copy link

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

@github-actionsgithub-actionsbot added the staleStale PR or inactive for long period of time. labelDec 11, 2021
Copy link
Contributor

@MaxwellDupreMaxwellDupre left a comment

Choose a reason for hiding this comment

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

Ran 203 tests in 0.198s

OK

== Tests result: SUCCESS ==
And I get:
>>> addr.exploded '0000:0000:0000:0000:0000:ffff:8.8.4.4'
Looks good to me.

opavlyuk reacted with hooray emoji
@ghost
Copy link

ghost commentedMay 3, 2022
edited by ghost
Loading

All commit authors signed the Contributor License Agreement.
CLA signed

…essesRepresent IPv4-mapped IPv6 address as x:x:x:x:x:x:d.d.d.d,where the 'x's are the hexadecimal valuesof the six high-order 16-bit pieces of the address,and the 'd's are the decimal valuesof the four low-order 8-bit pieces of the address(standard IPv4 representation).
@arhadthedevarhadthedev changed the titlebpo-43633 Improve the textual representation of IPv4-mapped IPv6 addressesgh-87799: Improve the textual representation of IPv4-mapped IPv6 addressesApr 13, 2023
@arhadthedevarhadthedev added the stdlibStandard Library Python modules in the Lib/ directory labelApr 13, 2023
@arhadthedev
Copy link
Member

@opavlyuk Could you sign the new CLA by clickingnot signed button in the cpython-cla-bot's message, please?

opavlyuk reacted with thumbs up emoji

@opavlyuk
Copy link
ContributorAuthor

opavlyuk commentedApr 13, 2023
edited
Loading

@arhadthedev Thanks for letting me know! I initially used the wrong SSH key for the commits, but I've fixed it and the CLA is now marked as signed.
Could you suggest what should I do next to move forward with this PR? Should I contact the python-dev mailing list or take any other steps?

arhadthedev reacted with thumbs up emoji

@arhadthedev
Copy link
Member

For now, we need to wait.

  1. Until 3.12b1 is out next month, core devs with network expertise can be busy with release blockers and PEP-grade features
  2. Core devs need time to process through their unread notification queue after work (a couple of days or so, maybe sooner, it depends)
  3. There is a feedback gathering month to give everybody a chance to participate in the PR.

@opavlyuk
Copy link
ContributorAuthor

@arhadthedev Thanks for clearing things up! Then I'll watch out for the 3.12b1 release and return to the PR once all obstacles are cleared.
It's been waiting here for a while, so I'd like to kindly help it move along when the time is right 🙂

maxmouchet reacted with eyes emoji

@opavlyuk
Copy link
ContributorAuthor

opavlyuk commentedMay 16, 2023
edited
Loading

@arhadthedev it appears a month has passed since the last update to the PR, during which time we haven't received further feedback. Also, I noticed that version 3.12.0a7 was released just yesterday.
I understand everyone is likely quite busy. Given these circumstances, do you think it might be appropriate to send a gentle reminder to our PR, in order to possibly draw the attention of the core developers?

maxmouchet reacted with thumbs up emoji

@opavlyuk
Copy link
ContributorAuthor

@encukou as you may recall, we had a conversation during PyCon SK 2022 where you kindly offered your guidance and support. I'm now writing to kindly ask if you could take a look at this PR. I would greatly appreciate your review, or if you could suggest someone who might be the right person for this task. Thank you for your time and consideration!

maxmouchet reacted with thumbs up emoji

@opavlyuk
Copy link
ContributorAuthor

@asvetlov could you please review this PR at your earliest convenience?
I understand that the ipaddress module has been without a maintainer for a while 😞
I'd appreciate if you could either take a look yourself or recommend someone appropriate for the task.

maxmouchet and ykvch reacted with thumbs up emoji

@miss-islington-app
Copy link

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

@ambvambv added needs backport to 3.9 needs backport to 3.10only security fixes needs backport to 3.11only security fixes needs backport to 3.12only security fixes and removed needs backport to 3.9 needs backport to 3.10only security fixes needs backport to 3.11only security fixes needs backport to 3.12only security fixes labelsJun 3, 2025
@miss-islington-app
Copy link

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

@miss-islington-app
Copy link

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

@miss-islington-app
Copy link

Thanks@opavlyuk for the PR, and@asvetlov for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

@miss-islington-app
Copy link

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestJun 3, 2025
…6 addresses (pythonGH-29345)Represent IPv4-mapped IPv6 address as x:x:x:x:x:x:d.d.d.d,where the 'x's are the hexadecimal valuesof the six high-order 16-bit pieces of the address,and the 'd's are the decimal valuesof the four low-order 8-bit pieces of the address(standard IPv4 representation).---------(cherry picked from commitf22bf8e)Co-authored-by: opavliuk <40970635+opavlyuk@users.noreply.github.com>Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestJun 3, 2025
…6 addresses (pythonGH-29345)Represent IPv4-mapped IPv6 address as x:x:x:x:x:x:d.d.d.d,where the 'x's are the hexadecimal valuesof the six high-order 16-bit pieces of the address,and the 'd's are the decimal valuesof the four low-order 8-bit pieces of the address(standard IPv4 representation).---------(cherry picked from commitf22bf8e)Co-authored-by: opavliuk <40970635+opavlyuk@users.noreply.github.com>Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
@bedevere-app
Copy link

GH-135078 is a backport of this pull request to the3.9 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestJun 3, 2025
…6 addresses (pythonGH-29345)Represent IPv4-mapped IPv6 address as x:x:x:x:x:x:d.d.d.d,where the 'x's are the hexadecimal valuesof the six high-order 16-bit pieces of the address,and the 'd's are the decimal valuesof the four low-order 8-bit pieces of the address(standard IPv4 representation).---------(cherry picked from commitf22bf8e)Co-authored-by: opavliuk <40970635+opavlyuk@users.noreply.github.com>Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
@bedevere-app
Copy link

GH-135079 is a backport of this pull request to the3.10 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.10only security fixes labelJun 3, 2025
@bedevere-app
Copy link

GH-135080 is a backport of this pull request to the3.11 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestJun 3, 2025
…6 addresses (pythonGH-29345)Represent IPv4-mapped IPv6 address as x:x:x:x:x:x:d.d.d.d,where the 'x's are the hexadecimal valuesof the six high-order 16-bit pieces of the address,and the 'd's are the decimal valuesof the four low-order 8-bit pieces of the address(standard IPv4 representation).---------(cherry picked from commitf22bf8e)Co-authored-by: opavliuk <40970635+opavlyuk@users.noreply.github.com>Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
@bedevere-appbedevere-appbot removed the needs backport to 3.11only security fixes labelJun 3, 2025
@bedevere-app
Copy link

GH-135081 is a backport of this pull request to the3.12 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.12only security fixes labelJun 3, 2025
ambv pushed a commit that referenced this pull requestJun 3, 2025
…v6 addresses (GH-29345) (GH-135080)Represent IPv4-mapped IPv6 address as x:x:x:x:x:x:d.d.d.d,where the 'x's are the hexadecimal valuesof the six high-order 16-bit pieces of the address,and the 'd's are the decimal valuesof the four low-order 8-bit pieces of the address(standard IPv4 representation).(cherry picked from commitf22bf8e)Co-authored-by: opavliuk <40970635+opavlyuk@users.noreply.github.com>Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
ambv pushed a commit that referenced this pull requestJun 3, 2025
…v6 addresses (GH-29345) (GH-135081)Represent IPv4-mapped IPv6 address as x:x:x:x:x:x:d.d.d.d,where the 'x's are the hexadecimal valuesof the six high-order 16-bit pieces of the address,and the 'd's are the decimal valuesof the four low-order 8-bit pieces of the address(standard IPv4 representation).(cherry picked from commitf22bf8e)Co-authored-by: opavliuk <40970635+opavlyuk@users.noreply.github.com>Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
ambv pushed a commit that referenced this pull requestJun 3, 2025
…6 addresses (GH-29345) (GH-135078)Represent IPv4-mapped IPv6 address as x:x:x:x:x:x:d.d.d.d,where the 'x's are the hexadecimal valuesof the six high-order 16-bit pieces of the address,and the 'd's are the decimal valuesof the four low-order 8-bit pieces of the address(standard IPv4 representation).(cherry picked from commitf22bf8e)Co-authored-by: opavliuk <40970635+opavlyuk@users.noreply.github.com>Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
ambv pushed a commit that referenced this pull requestJun 3, 2025
…v6 addresses (GH-29345) (GH-135079)Represent IPv4-mapped IPv6 address as x:x:x:x:x:x:d.d.d.d,where the 'x's are the hexadecimal valuesof the six high-order 16-bit pieces of the address,and the 'd's are the decimal valuesof the four low-order 8-bit pieces of the address(standard IPv4 representation).(cherry picked from commitf22bf8e)Co-authored-by: opavliuk <40970635+opavlyuk@users.noreply.github.com>Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@asvetlovasvetlovasvetlov approved these changes

+1 more reviewer

@MaxwellDupreMaxwellDupreMaxwellDupre approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

stdlibStandard Library Python modules in the Lib/ directory

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

9 participants

@opavlyuk@maxmouchet@arhadthedev@asvetlov@MaxwellDupre@ambv@the-knights-who-say-ni@ezio-melotti@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp