STINNER Victor added the comment: Python 2.7.11:
>>> import socket >>> socket.gethostname() '\xc9manuel-PC' This one works on Python 3 because the Python function is implemented with a call to the Windows native API. >>> socket.gethostbyaddr(socket.gethostname()) ('\xc9manuel-PC.home', [], ['fe80::c9b7:5117:eea4:a104']) This one fails on Python 3 because it uses the gethostbyaddr() C function and then decodes the hostname from UTF-8, whereas the hostname looks more to be encoded to ISO 8859-1 or something like that. IMHO it should be decoded from the ANSI code page. I opened the issue #26227 to track this bug. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26226> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com