$ python -m locale
Locale aliasing:
Locale defaults as determined by getdefaultlocale():
------------------------------------------------------------------------
Language: en_US
Encoding: UTF8
..
Locale settings after calling resetlocale():
------------------------------------------------------------------------
Traceback (most recent call last):
..
File "Lib/locale.py", line 548, in resetlocale
_setlocale(category, _build_localename(getdefaultlocale()))
locale.Error: unsupported locale setting
Apparently the problem is due to locale.getdefaultlocale() returning encoding as 'UTF8' while locale.setlocale() expects 'UTF-8'. |