[Python-checkins] cpython (3.5): Issue #5626: Remove misleading comment from socket.gethostname() documentation

berker.peksag python-checkins at python.org
Wed Jan 20 01:46:03 EST 2016


https://hg.python.org/cpython/rev/e1a711808cfe
changeset:   99994:e1a711808cfe
branch:      3.5
parent:      99991:7415a9386048
user:        Berker Peksag <berker.peksag at gmail.com>
date:        Wed Jan 20 08:45:37 2016 +0200
summary:
  Issue #5626: Remove misleading comment from socket.gethostname() documentation

A machine can have more than one IP addresses so
socket.gethostbyname(socket.gethostname()) probably won't return the correct
one.

files:
  Doc/library/socket.rst |  5 -----
  1 files changed, 0 insertions(+), 5 deletions(-)


diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst
--- a/Doc/library/socket.rst
+++ b/Doc/library/socket.rst
@@ -568,11 +568,6 @@
    Return a string containing the hostname of the machine where  the Python
    interpreter is currently executing.
 
-   If you want to know the current machine's IP address, you may want to use
-   ``gethostbyname(gethostname())``. This operation assumes that there is a
-   valid address-to-host mapping for the host, and the assumption does not
-   always hold.
-
    Note: :func:`gethostname` doesn't always return the fully qualified domain
    name; use :func:`getfqdn` for that.
 

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list