[issue10154] locale.normalize strips "-" from UTF-8, which fails on Mac

Ronald Oussoren report at bugs.python.org
Wed Oct 20 17:46:23 CEST 2010


Ronald Oussoren <ronaldoussoren at 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.

Ronald

----------
Added file: http://bugs.python.org/file19300/smime.p7s

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10154>
_______________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2224 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-bugs-list/attachments/20101020/bb9064c3/attachment.bin>


More information about the Python-bugs-list mailing list