Message118635
Martin v. Löwis wrote:
>
> New submission from Martin v. Löwis <martin@v.loewis.de>:
>
> Reportedly, platform.uname gives UnicodeError for non-ASCII computer names on Windows, see http://www.pasteall.org/16215
>
> I think it is incorrect that _node uses socket.gethostname on Windows. uname() should return the local hostname (i.e. the one that the system itself believes to have), independent of the network configuration or DNS.
>
> Therefore, I think it should return the COMPUTERNAME environment variable, or the result of the GetComputerName() API.
There are two issues here:
1. socket.gethostname() shouldn't raise an error on Windows, but
return the Unicode host name
2. COMPUTERNAME returns an uppercase version of the host name (which we
could lowercase to stay b/w compatible), however I'm not sure
whether this is the same as the socket.gethostname() or the
NETBIOS name and I'm also not sure whether this is always set.
This link suggests that it's using the NetBIOS name:
http://www.scriptlogic.com/support/CustomScripts/environmentVariableReference.html
The official Microsoft page is unclear about this:
http://technet.microsoft.com/en-gb/library/bb490954.aspx
Could someone please check whether using the environment
variable COMPUTERNAME would work in the described case ?
What we could do is use the socket.gethostname() and fall back
to COMPUTERNAME in case of decoding problems.
Thanks,
--
Marc-Andre Lemburg
eGenix.com
________________________________________________________________________
::: Try our new mxODBC.Connect Python Database Interface for free ! ::::
eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48
D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
Registered at Amtsgericht Duesseldorf: HRB 46611
http://www.egenix.com/company/contact/ |
|
Date |
User |
Action |
Args |
2010-10-14 08:38:29 | lemburg | set | recipients:
+ lemburg, loewis |
2010-10-14 08:38:27 | lemburg | link | issue10097 messages |
2010-10-14 08:38:27 | lemburg | create | |
|