[issue35164] socket.getfqdn and socket.gethostbyname fail on MacOS

Ned Deily report at bugs.python.org
Sun Nov 4 12:00:57 EST 2018


Ned Deily <nad at python.org> added the comment:

Thanks for the report but I don't think the problem you are seeing is that simple.  On my 10.14.1 system, I don't see that problem:

$ scutil --get HostName
HostName: not set
$ /usr/local/bin/python3.7
Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 03:13:28)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> socket.gethostname()
'harj.local'
>>> socket.gethostbyname(socket.gethostname())
'10.0.1.8'
>>>

So there's likely some other configuration issue here.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35164>
_______________________________________


More information about the Python-bugs-list mailing list