Skip to content

Conversation

@akulakov
Copy link
Contributor

@akulakov akulakov commented Aug 26, 2021

@akulakov akulakov changed the title Fix getfqdn() docstring and docs bpo-40635: Fix getfqdn() docstring and docs Aug 26, 2021
Copy link
Member

@Fidget-Spinner Fidget-Spinner left a comment

Choose a reason for hiding this comment

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

Thanks Andrei, this LGTM. But let's hear from a socket/networking expert first (and whether they want a news item).

Comment on lines 810 to 812
host, if available. The first name which includes a period is selected. If FQDN is not
available and *name* is empty or is ``'0.0.0.0'``, hostname from :func:`gethostname` is
returned. Otherwise, *name* is returned unchanged.
Copy link
Contributor

Choose a reason for hiding this comment

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

Please don't exceed 79 characters per line.

Suggested change
host, if available. The first name which includes a period is selected. If FQDN is not
available and *name* is empty or is ``'0.0.0.0'``, hostname from :func:`gethostname` is
returned. Otherwise, *name* is returned unchanged.
host, if available. The first name which includes a period is selected. In
case no fully qualified domain name is available and *name* was provided,
it is returned unchanged. If *name* was empty or equal to ``'0.0.0.0'``,
the hostname as returned by :func:`gethostname` is returned.

Copy link
Contributor Author

@akulakov akulakov Aug 26, 2021

Choose a reason for hiding this comment

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

'as returned ... is returned' reads a bit awkward I think, is it okay if I use the same wording as in your suggestion for the docstring? ; which is:

[...] hostname from gethostname() is returned.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure, agreed. I just used what was originally in the doc but you're right that the docstring version is an improvement.

@ambv ambv added the skip news label Aug 26, 2021
akulakov and others added 3 commits August 26, 2021 12:32
@ambv ambv merged commit fdcb675 into python:main Aug 26, 2021
@miss-islington
Copy link
Contributor

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 26, 2021
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit fdcb675)

Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
@bedevere-bot
Copy link

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

@bedevere-bot bedevere-bot removed the needs backport to 3.10 only security fixes label Aug 26, 2021
@bedevere-bot
Copy link

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 26, 2021
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit fdcb675)

Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
@akulakov akulakov deleted the 40635-Fix-socket-getfqdn-docs branch August 26, 2021 18:42
@akulakov
Copy link
Contributor Author

Thanks @ambv and @Fidget-Spinner for reviewing :)

miss-islington added a commit that referenced this pull request Aug 26, 2021
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit fdcb675)

Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
miss-islington added a commit that referenced this pull request Aug 26, 2021
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit fdcb675)

Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants