Skip to content

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

Merged
ambv merged 1 commit intopython:mainfrom
andresdelfino:fix_gethostbyname_ex_doc
Oct 5, 2021
Merged

[doc] Fix copy & paste mistake in gethostbyname_ex#28700
ambv merged 1 commit intopython:mainfrom
andresdelfino:fix_gethostbyname_ex_doc

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..

@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 <adelfino@gmail.com>
@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 <adelfino@gmail.com>
@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 <adelfino@gmail.com>
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 <adelfino@gmail.com>

Co-authored-by: Andre Delfino <adelfino@gmail.com>
@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