BPO | [10090](https://bugs.python.org/issue10090) --- | :--- Nosy | @malemburg, @loewis, @ronaldoussoren, @abalkin, @merwok Dependencies | bpo-10154: locale.normalize strips "-" from UTF-8, which fails on Mac *Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.* Show more details GitHub fields: ```python assignee = None closed_at = created_at = labels = ['type-bug', 'library'] title = 'python -m locale fails on OSX' updated_at = user = 'https://github.com/abalkin' ``` bugs.python.org fields: ```python activity = actor = 'ronaldoussoren' assignee = 'none' closed = True closed_date = closer = 'ronaldoussoren' components = ['Library (Lib)'] creation = creator = 'belopolsky' dependencies = ['10154'] files = [] hgrepos = [] issue_num = 10090 keywords = [] message_count = 2.0 messages = ['118567', '136151'] nosy_count = 5.0 nosy_names = ['lemburg', 'loewis', 'ronaldoussoren', 'belopolsky', 'eric.araujo'] pr_nums = [] priority = 'normal' resolution = 'fixed' stage = 'resolved' status = 'closed' superseder = None type = 'behavior' url = 'https://bugs.python.org/issue10090' versions = ['Python 3.1', 'Python 2.7', 'Python 3.2'] ```
Activity
abalkin commentedon Oct 13, 2010
Locale defaults as determined by getdefaultlocale():
------------------------------------------------------------------------
Language: en_US
Encoding: UTF8
..
Locale settings after calling resetlocale():
------------------------------------------------------------------------
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'.
ronaldoussoren commentedon May 17, 2011
I've applied a fix for bpo-10154 and that also fixes this problem.