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

Commitf1e3fc4

Browse files
bpo-40635: Fix getfqdn() docstring and docs (GH-27971)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>(cherry picked from commitfdcb675)Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
1 parent970533e commitf1e3fc4

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

‎Doc/library/socket.rst‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -795,8 +795,9 @@ The :mod:`socket` module also offers various network-related services:
795795
it is interpreted as the local host. To find the fully qualified name, the
796796
hostname returned by:func:`gethostbyaddr` is checked, followed by aliases for the
797797
host, if available. The first name which includes a period is selected. In
798-
case no fully qualified domain name is available, the hostname as returned by
799-
:func:`gethostname` is returned.
798+
case no fully qualified domain name is available and *name* was provided,
799+
it is returned unchanged. If *name* was empty or equal to ``'0.0.0.0'``,
800+
the hostname from:func:`gethostname` is returned.
800801

801802

802803
..function::gethostbyname(hostname)

‎Lib/socket.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -781,8 +781,9 @@ def getfqdn(name=''):
781781
An empty argument is interpreted as meaning the local host.
782782
783783
First the hostname returned by gethostbyaddr() is checked, then
784-
possibly existing aliases. In case no FQDN is available, hostname
785-
from gethostname() is returned.
784+
possibly existing aliases. In case no FQDN is available and `name`
785+
was given, it is returned unchanged. If `name` was empty or '0.0.0.0',
786+
hostname from gethostname() is returned.
786787
"""
787788
name=name.strip()
788789
ifnotnameorname=='0.0.0.0':

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp