From 21a92803d1136623ee36cef36fa55d6decbae216 Mon Sep 17 00:00:00 2001 From: slateny <46876382+slateny@users.noreply.github.com> Date: Thu, 2 Jun 2022 23:21:03 -0700 Subject: [PATCH 1/5] Be explicit about socket.getfqdn --- Doc/library/socket.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst index 3a931e25de91e5..0da2fa7730d4f3 100644 --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -966,7 +966,8 @@ The :mod:`socket` module also offers various network-related services: .. function:: getfqdn([name]) 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 + it is interpreted as the local host (as returned by :func:`gethostname`). + To find the fully qualified name, the hostname returned by :func:`gethostbyaddr` is checked, followed by aliases for the 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, From dd58cfecae8d09e9996720d8339d1263324359f4 Mon Sep 17 00:00:00 2001 From: slateny <46876382+slateny@users.noreply.github.com> Date: Thu, 2 Jun 2022 23:47:43 -0700 Subject: [PATCH 2/5] Move description from last sentence to top --- Doc/library/socket.rst | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst index 0da2fa7730d4f3..e60143142a5788 100644 --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -965,14 +965,13 @@ The :mod:`socket` module also offers various network-related services: .. function:: getfqdn([name]) - Return a fully qualified domain name for *name*. If *name* is omitted or empty, - it is interpreted as the local host (as returned by :func:`gethostname`). + 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. To find the fully qualified name, the hostname returned by :func:`gethostbyaddr` is checked, followed by aliases for the 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 from :func:`gethostname` is returned. + it is returned unchanged. .. function:: gethostbyname(hostname) From 9dcdc90c1336e00cafc10065a50c305faf3f660c Mon Sep 17 00:00:00 2001 From: slateny <46876382+slateny@users.noreply.github.com> Date: Sun, 3 Mar 2024 12:16:08 -0800 Subject: [PATCH 3/5] Corrected getfqdn ordering and phrasing; small grammar fix --- Doc/library/socket.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst index e60143142a5788..ef97ece1381508 100644 --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -827,8 +827,8 @@ The following functions all create :ref:`socket objects `. ``(host, port)``) and returns the socket object. *family* should be either :data:`AF_INET` or :data:`AF_INET6`. - *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. *reuse_port* dictates whether to set the :data:`SO_REUSEPORT` socket option. If *dualstack_ipv6* is true and the platform supports it the socket will @@ -963,15 +963,15 @@ The :mod:`socket` module also offers various network-related services: for IPv6 multicast addresses, string representing an address will not contain ``%scope_id`` part. -.. function:: getfqdn([name]) +.. function:: getfqdn(name='') - 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. + Return a fully qualified domain name for *name*. To find the fully qualified name, the hostname returned by :func:`gethostbyaddr` is checked, followed by aliases for the 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. + it is returned unchanged. If *name* is empty, or equal to "0.0.0.0", "::", or "", + the hostname from :func:`gethostname` is returned. .. function:: gethostbyname(hostname) From 6bb37ce7f76f30172db672024a4ee8d319aa29ea Mon Sep 17 00:00:00 2001 From: slateny <46876382+slateny@users.noreply.github.com> Date: Sun, 3 Mar 2024 12:20:30 -0800 Subject: [PATCH 4/5] Change to single quotes and add ` --- Doc/library/socket.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst index ef97ece1381508..bc412fc727f0da 100644 --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -970,8 +970,8 @@ The :mod:`socket` module also offers various network-related services: hostname returned by :func:`gethostbyaddr` is checked, followed by aliases for the 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* is empty, or equal to "0.0.0.0", "::", or "", - the hostname from :func:`gethostname` is returned. + it is returned unchanged. If *name* is empty, or equal to ``'0.0.0.0'``, ``'::'``, + or ``''``, the hostname from :func:`gethostname` is returned. .. function:: gethostbyname(hostname) From 025536e1e387307d9bd7532993a12697a4058c20 Mon Sep 17 00:00:00 2001 From: slateny <46876382+slateny@users.noreply.github.com> Date: Sun, 3 Mar 2024 12:22:20 -0800 Subject: [PATCH 5/5] empty -> omitted --- Doc/library/socket.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst index bc412fc727f0da..2a540b689f5442 100644 --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -970,8 +970,8 @@ The :mod:`socket` module also offers various network-related services: hostname returned by :func:`gethostbyaddr` is checked, followed by aliases for the 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* is empty, or equal to ``'0.0.0.0'``, ``'::'``, - or ``''``, the hostname from :func:`gethostname` is returned. + it is returned unchanged. If *name* is omitted, or equal to ``'0.0.0.0'``, + ``'::'``, or ``''``, the hostname from :func:`gethostname` is returned. .. function:: gethostbyname(hostname)