Author rg3
Recipients georg.brandl, groodt, loewis, r.david.murray, rg3
Date 2012-07-11.16:45:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I don't know if the behavior is considered a bug or just undocumented, but under Python 2.7.3 it's still the same. locale.getpreferredencoding() does return UTF-8, but the second element in the tuple locale.getdefaultlocale() is "utf_8_valencia", which is not a valid encoding despite the documentation saying it's supposed to be an encoding name.

From my terminal:

$ python -V
Python 2.7.3

$ LANG=ca_ES.UTF-8@valencia python -c 'import locale; print locale.getpreferredencoding()'

$ LANG=ca_ES.UTF-8@valencia python -c 'import locale; print locale.getdefaultlocale()'
('ca_ES', 'utf_8_valencia')

$ LANG=ca_ES.UTF-8 python -c 'import locale; print locale.getpreferredencoding()'

$ LANG=ca_ES.UTF-8 python -c 'import locale; print locale.getdefaultlocale()'
('ca_ES', 'UTF-8')
Date User Action Args
2012-07-11 16:45:39rg3setrecipients: + rg3, loewis, georg.brandl, r.david.murray, groodt
2012-07-11 16:45:39rg3setmessageid: <>
2012-07-11 16:45:38rg3linkissue5815 messages
2012-07-11 16:45:38rg3create