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 loewis
Recipients lemburg, loewis
Date 2010-10-14.17:15:32
SpamBayes Score 9.144434e-08
Marked as misclassified No
Message-id <4CB73AB2.1010901@v.loewis.de>
In-reply-to <4CB6C502.3090202@egenix.com>
Content
> More evidence that the NetBIOS name is used:
> 
> http://msdn.microsoft.com/en-us/library/aa368009(VS.85).aspx
> http://msdn.microsoft.com/en-us/library/ms724295(v=VS.85).aspx
> 
> One problem with this approach is that changes to the NetBIOS name
> are not seen by those APIs and variables, e.g. if the machine
> get's an update via DHCP. The other is that NetBIOS itself is
> being phased out in favor of DNS names - which socket.gethostname()
> returns, so we'd be replacing a new technology with an old one.

I think you misunderstand. It's not that this API returns the NetBIOS
name, but that NetBIOS really uses the same name that people understand
as their "computer name".

It's incorrect to use DNS names when implementing platform.uname():
on POSIX, uname() *also* does not return the DNS name. If you want
some API to return the DNS name of the computer, you need a different
function (e.g. socket.getfqdn()).

> BTW: Why doesn't socket.gethostname() use GetComputerNameEx()
> which does support Unicode ?

gethostname was specified by Berkeley Unix (4.2BSD specifically).
Microsoft can't just change the signature of the function.

If you are asking whether Python's socket.gethostname calls
gethostname: because this is the whole point of this function.
It would be very confusing if the function didn't call the
same-named platform API.
History
Date User Action Args
2010-10-14 17:15:34loewissetrecipients: + loewis, lemburg
2010-10-14 17:15:32loewislinkissue10097 messages
2010-10-14 17:15:32loewiscreate