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 baikie
Recipients baikie, ezio.melotti, jesterKing, lemburg, loewis, vstinner
Date 2010-10-21.22:37:22
SpamBayes Score 9.62716e-11
Marked as misclassified No
Message-id <>
In-reply-to <>
> On other platforms, I guess we'll just have to do some trial
> and error to see what works and what not. E.g. on Linux it is
> possible to set the hostname to a non-ASCII value, but then
> the resolver returns an error, so it's not very practical:
> # hostname l\303\266wis
> # hostname
> löwis
> # hostname -f
> hostname: Resolver Error 0 (no error)
> Using the IDNA version doesn't help either:
> # hostname xn--lwis-5qa
> # hostname
> xn--lwis-5qa
> # hostname -f
> hostname: Resolver Error 0 (no error)

I think what's happening here is that simply that you're setting
the hostname to something which doesn't exist in the relevant
name databases - the man page for Linux's hostname(1) says that
"The FQDN is the name gethostbyname(2) returns for the host name
returned by gethostname(2).".  If the computer's usual name is
"newton", that may be why it works and the others don't.

It works for me if I add " lö löwis" to
/etc/hosts and then set the hostname to "löwis" (all UTF-8):
hostname -f prints "lö", and Python 2's
socket.getfqdn() returns the corresponding bytes; non-UTF-8 names
work too.  (Note that the FQDN must appear before the bare
hostname in the /etc/hosts entry, and I used the address simply to avoid a collision with existing entries - by
default, Ubuntu assigns the FQDN to
Date User Action Args
2010-10-21 22:37:25baikiesetrecipients: + baikie, lemburg, loewis, vstinner, ezio.melotti, jesterKing
2010-10-21 22:37:23baikielinkissue9377 messages
2010-10-21 22:37:22baikiecreate