classification
Title: python -m locale fails on OSX
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.1, Python 3.2, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: 10154 Superseder:
Assigned To: Nosy List: belopolsky, eric.araujo, lemburg, loewis, ronaldoussoren
Priority: normal Keywords:

Created on 2010-10-13 19:33 by belopolsky, last changed 2011-05-17 12:15 by ronaldoussoren. This issue is now closed.

Messages (2)
msg118567 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2010-10-13 19:33
$ 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'.
msg136151 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2011-05-17 12:15
I've applied a fix for #10154 and that also fixes this problem.
History
Date User Action Args
2011-05-17 12:15:25ronaldoussorensetstatus: open -> closed

nosy: + ronaldoussoren
messages: + msg136151

resolution: fixed
stage: test needed -> resolved
2010-10-22 17:37:08eric.araujosetdependencies: + locale.normalize strips "-" from UTF-8, which fails on Mac
2010-10-19 16:58:02eric.araujosetnosy: + loewis, eric.araujo

versions: - Python 2.6
2010-10-17 03:37:51r.david.murraysetnosy: + lemburg
2010-10-13 19:33:11belopolskycreate