Skip to content

[doc] Fix copy & paste mistake in gethostbyname_ex #28700

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 5, 2021

Conversation

andresdelfino
Copy link
Contributor

It seems part of gethostbyname_ex doc was copied from gethostbyaddr (which has an ip_address parameter).

Not sure if the proposed wording is correct, though, as it not clear to me what is going on with the hostname returned. Not sure if it's exactly the hostname passed as argument. Tried to read the C, but, yeah..

@bedevere-bot bedevere-bot added the docs Documentation in the Doc dir label Oct 2, 2021
@ambv ambv added needs backport to 3.9 only security fixes needs backport to 3.10 only security fixes labels Oct 5, 2021
@ambv ambv merged commit 4103280 into python:main Oct 5, 2021
@miss-islington
Copy link
Contributor

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 5, 2021
It seems part of `gethostbyname_ex` doc was copied from `gethostbyaddr`. The latter has an `ip_address` parameter whereas the former doesn't.
(cherry picked from commit 4103280)

Co-authored-by: Andre Delfino <[email protected]>
@bedevere-bot bedevere-bot removed the needs backport to 3.10 only security fixes label Oct 5, 2021
@bedevere-bot
Copy link

GH-28742 is a backport of this pull request to the 3.10 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 5, 2021
It seems part of `gethostbyname_ex` doc was copied from `gethostbyaddr`. The latter has an `ip_address` parameter whereas the former doesn't.
(cherry picked from commit 4103280)

Co-authored-by: Andre Delfino <[email protected]>
@bedevere-bot bedevere-bot removed the needs backport to 3.9 only security fixes label Oct 5, 2021
@bedevere-bot
Copy link

GH-28743 is a backport of this pull request to the 3.9 branch.

@ambv
Copy link
Contributor

ambv commented Oct 5, 2021

Thanks for the fix, @andresdelfino. The returned hostname is the primary hostname of the given host. This means it's the same as the given hostname if there are no aliases:

>>> socket.gethostbyname_ex('lukasz.langa.pl')
('lukasz.langa.pl', [], ['66.111.4.53', '66.111.4.54'])

In case aliases exist and you passed one of them to the function, the returned primary hostname can be different:

>>> socket.gethostbyname_ex('www.facebook.com')
('star-mini.c10r.facebook.com', ['www.facebook.com'], ['157.240.20.35'])

ambv pushed a commit that referenced this pull request Oct 5, 2021
It seems part of `gethostbyname_ex` doc was copied from `gethostbyaddr`. The latter has an `ip_address` parameter whereas the former doesn't.
(cherry picked from commit 4103280)

Co-authored-by: Andre Delfino <[email protected]>
ambv pushed a commit that referenced this pull request Oct 5, 2021
It seems part of `gethostbyname_ex` doc was copied from `gethostbyaddr`. The latter has an `ip_address` parameter whereas the former doesn't.
(cherry picked from commit 4103280)

Co-authored-by: Andre Delfino <[email protected]>

Co-authored-by: Andre Delfino <[email protected]>
@andresdelfino andresdelfino deleted the fix_gethostbyname_ex_doc branch October 5, 2021 22:30
@andresdelfino
Copy link
Contributor Author

Thanks for the fix, @andresdelfino. The returned hostname is the primary hostname of the given host. This means it's the same as the given hostname if there are no aliases:

>>> socket.gethostbyname_ex('lukasz.langa.pl')
('lukasz.langa.pl', [], ['66.111.4.53', '66.111.4.54'])

In case aliases exist and you passed one of them to the function, the returned primary hostname can be different:

>>> socket.gethostbyname_ex('www.facebook.com')
('star-mini.c10r.facebook.com', ['www.facebook.com'], ['157.240.20.35'])

Thanks for the explanation!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip issue skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants