New submission from Ned Deily <n...@acm.org>: The documentation for socket.gethostname() contains the following comment:
"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." This comment leads to the mistaken assumption that a machine has only one IP address, an assumption which results in bugs such as in Issue5625. The comment also does not deal with other address families, i.e. IPv6 addresses. Either the paragraph should be expanded to cover multiple addresses and families, requiring the use of other socket functions, or the paragraph should simply be removed. ---------- assignee: georg.brandl components: Documentation messages: 84816 nosy: georg.brandl, nad severity: normal status: open title: misleading comment in socket.gethostname() documentation versions: Python 2.6, Python 2.7, Python 3.0, Python 3.1 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue5626> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com