[virt-tools-list] virt-manager: "locale.Error: unsupported locale setting" error and workaround

Julio Faracco jcfaracco at gmail.com
Mon Sep 22 17:42:14 UTC 2014


Hi Cole!

This issue is not happening with me. It is happening with another user here.
Today, he sent to me the message:

*Gtk-WARNING **: Locale not supported by C library.    Using the fallback
'C' locale.*

Sorry, I'm not want to say that my patch really fix something, because
virt-manager works
fine without locale.setlocale(locale.LC_ALL, ''). But as described into
python documentation:

"


*getdefaultlocale(): According to POSIX, a program which has not called
setlocale(LC_ALL, '')runs using the portable 'C' locale. Calling
setlocale(LC_ALL, '') lets it use the default locale as defined by the LANG
variable. Since we do not want to interfere with the current locale setting
we thus emulate the behavior in the way described above*."

So, the intention is to avoid that Gtk uses the portable 'C' locale
changing the "pass" into
locale.setlocale(locale.LC_ALL, locale.getdefaultlocale()) since
getdefaultlocale() will return
the content of LANG. Well, as we see today it is not working even if we set
using the
getdefaultlocale() when glibc-common has a locale bug. Gtk is still using
'C' locale.

Strange.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/virt-tools-list/attachments/20140922/1f79474c/attachment.htm>


More information about the virt-tools-list mailing list