This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author lemburg
Recipients baikie, ezio.melotti, jesterKing, lemburg, loewis, vstinner
Date 2010-10-14.18:29:03
SpamBayes Score 1.8825881e-07
Marked as misclassified No
Message-id <1287080945.04.0.827985557963.issue9377@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2010-10-14 18:29:05lemburgsetrecipients: + lemburg, loewis, vstinner, baikie, ezio.melotti, jesterKing
2010-10-14 18:29:05lemburgsetmessageid: <1287080945.04.0.827985557963.issue9377@psf.upfronthosting.co.za>
2010-10-14 18:29:03lemburglinkissue9377 messages
2010-10-14 18:29:03lemburgcreate