From fdcb675eed47b1f6054fae381af4388b16a6fff4 Mon Sep 17 00:00:00 2001 From: andrei kulakov Date: Thu, 26 Aug 2021 14:40:28 -0400 Subject: bpo-40635: Fix getfqdn() docstring and docs (GH-27971) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Ɓukasz Langa --- Lib/socket.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Lib/socket.py') diff --git a/Lib/socket.py b/Lib/socket.py index a64ae400ce..ef82c496cb 100755 --- a/Lib/socket.py +++ b/Lib/socket.py @@ -782,8 +782,9 @@ def getfqdn(name=''): An empty argument is interpreted as meaning the local host. First the hostname returned by gethostbyaddr() is checked, then - possibly existing aliases. In case no FQDN is available, hostname - from gethostname() is returned. + possibly existing aliases. In case no FQDN is available and `name` + was given, it is returned unchanged. If `name` was empty or '0.0.0.0', + hostname from gethostname() is returned. """ name = name.strip() if not name or name == '0.0.0.0': -- cgit v1.2.1