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-60856: Be explicit about localhost for socket.getfqdn#93451

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

Open
slateny wants to merge5 commits intopython:main
base:main
Choose a base branch
Loading
fromslateny:s/60856

Conversation

@slateny
Copy link
Contributor

@slatenyslateny commentedJun 3, 2022
edited
Loading

@bedevere-botbedevere-bot added docsDocumentation in the Doc dir awaiting review labelsJun 3, 2022
@slatenyslateny marked this pull request as draftJune 3, 2022 06:25
@slateny
Copy link
ContributorAuthor

Noticed there's duplicate wording in the last sentence, will change the PR for that

@slatenyslateny marked this pull request as ready for reviewJune 3, 2022 06:48
@iritkatrieliritkatriel requested a review fromambvOctober 4, 2022 22:32
Return a fully qualified domain name for *name*. If *name* is omitted or empty,
it is interpreted as the local host. To find the fully qualified name, the
Return a fully qualified domain name for *name*. If *name* is empty or equal to
``'0.0.0.0'``, the hostname from:func:`gethostname` is returned.

Choose a reason for hiding this comment

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

Is it so? Looking at the sources, it tries to return one of names returned bygethostbyaddr(gethostname()).

The new wording also leaves unclear whatgetfqdn() returns.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

The source/behavior was changed in#100375 after this PR was opened, so wording definitely does need updating.

Regarding the unclear new wording, could you expand on that? My interpretation is that previously the entire paragraph needs to be read through before the return ofgetfqdn(), but now it's right at the top:If *name* is empty ...

Choose a reason for hiding this comment

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

Now it starts from the rare corner case (why would anyone pass an empty name togetfqdn()?), but the documentation forgetfqdn() without arguments is removed.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

You are very correct, leaving out the empty argument is my mistake. What do you think about this instead?

Return a fully qualified domain name for *name*.To find the fully qualified name, ......... it is returned unchanged.If *name* is empty, or equal to "0.0.0.0," "::", or "",the hostname from :func:`gethostname` is returned.

There's also an option of changinggetfqdn([name]) togetfqdn(name=''), but not sure if it helps with improving the wording much.

Choose a reason for hiding this comment

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

I think that both changing the wording and changing the signature are worth to do.

slateny reacted with thumbs up emoji
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Done, let me know if there's anything that looks off. For reference,here's the preview ofgetfqdn.

*backlog* is the queue size passed to:meth:`socket.listen`; if not specified
, a default reasonable value is chosen.
*backlog* is the queue size passed to:meth:`socket.listen`; if not
specified, a default reasonable value is chosen.
Copy link
ContributorAuthor

@slatenyslatenyMar 3, 2024
edited
Loading

Choose a reason for hiding this comment

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

Small formatting fix to remove space before comma forthis:

image

@python-cla-bot
Copy link

The following commit authors need to sign the Contributor License Agreement:

CLA signed

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@serhiy-storchakaserhiy-storchakaserhiy-storchaka left review comments

@ambvambvAwaiting requested review from ambv

Assignees

No one assigned

Labels

awaiting reviewdocsDocumentation in the Doc dirskip news

Projects

Status: Todo

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@slateny@serhiy-storchaka@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp