GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-60856: Be explicit about localhost for socket.getfqdn by slateny · Pull Request #93451 · python/cpython

Conversation

@slateny

@slateny slateny commented Jun 3, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

#60856

This moves the wording from #27971 to the front to reduce the duplicated wording

https://docs.python.org/3/library/socket.html#socket.getfqdn

https://github.com/python/cpython/blob/main/Lib/socket.py#L792

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-bot bedevere-bot added docs Documentation in the Doc dir awaiting review labels Jun 3, 2022
@slateny slateny added the skip news label Jun 3, 2022
@slateny
slateny marked this pull request as draft June 3, 2022 06:25
@slateny

slateny commented Jun 3, 2022

Copy link
Copy Markdown
Contributor Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@slateny
slateny marked this pull request as ready for review June 3, 2022 06:48
@iritkatriel
iritkatriel requested a review from ambv October 4, 2022 22:32
serhiy-storchaka
serhiy-storchaka reviewed Feb 21, 2024
View reviewed changes
Comment thread Doc/library/socket.rst Outdated
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.

@serhiy-storchaka serhiy-storchaka Feb 21, 2024

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

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 by gethostbyaddr(gethostname()).

The new wording also leaves unclear what getfqdn() returns.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@slateny slateny Feb 27, 2024

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

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 of getfqdn(), but now it's right at the top: If *name* is empty ...

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@serhiy-storchaka serhiy-storchaka Feb 27, 2024

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

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 to getfqdn()?), but the documentation for getfqdn() without arguments is removed.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@slateny slateny Mar 2, 2024

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

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 changing getfqdn([name]) to getfqdn(name=''), but not sure if it helps with improving the wording much.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@serhiy-storchaka serhiy-storchaka Mar 3, 2024

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

slateny reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@slateny slateny Mar 6, 2024

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
slateny added 2 commits March 3, 2024 12:07
@slateny
Be explicit about socket.getfqdn
21a9280
@slateny
Move description from last sentence to top
dd58cfe
@slateny
slateny force-pushed the s/60856 branch from 7c0cd32 to dd58cfe Compare March 3, 2024 20:07
@bedevere-app bedevere-app Bot mentioned this pull request Mar 3, 2024
[doc] socket.getfqdn docs are not explicit enough about the algorithm. #60856
Open
@slateny
Corrected getfqdn ordering and phrasing; small grammar fix
9dcdc90
slateny
slateny commented Mar 3, 2024
View reviewed changes
Comment thread Doc/library/socket.rst
*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.

@slateny slateny Mar 3, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

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 for this:

image

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
slateny added 2 commits March 3, 2024 12:20
@slateny
Change to single quotes and add `
6bb37ce
@slateny
empty -> omitted
025536e
@python-cla-bot

python-cla-bot Bot commented Apr 18, 2025

Copy link
Copy Markdown

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

  • [email protected]

CLA signed

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Apr 11, 2026

Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Apr 11, 2026
@ambv

ambv commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

This PR has been blocked on an unsigned CLA for more than 12 months and cannot be merged until all commit authors sign. Closing to cull the number of open pull requests. Do not reopen this pull request without signing the CLA first and getting a go-ahead from a triager or core developer on gh-60856.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ambv ambv closed this Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@serhiy-storchaka serhiy-storchaka serhiy-storchaka left review comments
@ambv ambv Awaiting requested review from ambv

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

awaiting review docs Documentation in the Doc dir skip news stale Stale PR or inactive for long period of time.

Projects

Docs PRs
Status: Todo

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@slateny @ambv @serhiy-storchaka @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.