Marc-Andre Lemburg <m...@egenix.com> added the comment:

Ronald Oussoren wrote:
> 
> Ronald Oussoren <ronaldousso...@mac.com> added the comment:
> 
> This patch solves the immediate failure:
> 
> Index: Lib/locale.py
> ===================================================================
> --- Lib/locale.py     (revision 85743)
> +++ Lib/locale.py     (working copy)
> @@ -396,6 +396,9 @@
>          else:
>              encoding = defenc
>          #print 'found encoding %r' % encoding
> +        if sys.platform == 'darwin' and encoding == 'UTF8':
> +            encoding = 'UTF-8'
> +
>          if encoding:
>              return langname + '.' + encoding
>          else:
> 
> I'm not happy about hardcoding this specific exception though, there should 
> be a better solution than this.

Could you tell me the values of localename, code, langname and encoding
at that step in the process ?

We may need to add an locale_encoding_alias from 'UTF8' to 'UTF-8',
since the version with the hyphen is what the C lib uses.

----------
nosy: +lemburg
title: locale.normalize strips "-" from UTF-8, which fails on Mac -> 
locale.normalize strips "-" from UTF-8,    which fails on Mac

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue10154>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to