Skip to content
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

bpo-40635: Fix getfqdn() docstring and docs #27971

Merged
merged 7 commits into from
Aug 26, 2021

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
@Fidget-Spinner Fidget-Spinner added needs backport to 3.9 only security fixes needs backport to 3.10 only security fixes labels 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.

Lib/socket.py Outdated Show resolved Hide resolved
@ambv ambv added the skip news label Aug 26, 2021
@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 <[email protected]>
(cherry picked from commit fdcb675)

Co-authored-by: andrei kulakov <[email protected]>
@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.

@bedevere-bot bedevere-bot removed the needs backport to 3.9 only security fixes label Aug 26, 2021
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 26, 2021
Co-authored-by: Łukasz Langa <[email protected]>
(cherry picked from commit fdcb675)

Co-authored-by: andrei kulakov <[email protected]>
@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 <[email protected]>
(cherry picked from commit fdcb675)

Co-authored-by: andrei kulakov <[email protected]>
miss-islington added a commit that referenced this pull request Aug 26, 2021
Co-authored-by: Łukasz Langa <[email protected]>
(cherry picked from commit fdcb675)

Co-authored-by: andrei kulakov <[email protected]>
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