Marc-Andre Lemburg <m...@egenix.com> added the comment:

Regarding fixing the issue at hand on Windows, I think Python should use the 
corresponding win32 API for getting the hostname: GetComputerNameEx().

It supports Unicode, so the encoding issue doesn't arise.

See  http://msdn.microsoft.com/en-us/library/ms724301(v=VS.85).aspx for details.

This also solves the platform.uname() issue mentioned here, since the uname() 
emulation for Windows relies on socket.gethostname() to determine the node name.

FWIW: Glib C does the reverse...

       The  GNU  C library implements gethostname() as a library function that 
calls
       uname(2) and copies up to len bytes from the  returned  nodename  field  
into
       name.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue9377>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to