This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2011年06月29日 18:51 by exarkun, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Messages (3) | |||
|---|---|---|---|
| msg139445 - (view) | Author: Jean-Paul Calderone (exarkun) * (Python committer) | Date: 2011年06月29日 18:51 | |
Consider this transcript from OS X 10.6:
>>> import locale
>>> locale.getlocale()
(None, None)
>>> locale.setlocale(locale.LC_ALL, _)
'C'
>>> locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')
'en_US.UTF-8'
>>> locale.getlocale()
('en_US', 'UTF8')
>>> locale.setlocale(locale.LC_ALL, _)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/locale.py", line 494, in setlocale
return _setlocale(category, locale)
locale.Error: unsupported locale setting
>>>
OS X does not recognize 'en_US.UTF8', only 'en_US.UTF-8'. However, when passed a tuple, the locale module tries to normalize the values. It ends up turning the result of getlocale from ('en_US', 'UTF-8') into 'en_US.UTF8'.
|
|||
| msg139446 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2011年06月29日 18:55 | |
Good news: it's a duplicate and it's already fixed! See issues #10090 and #10154. The fix is part of Python 3.1.4 (released the 12th june 2011) and Python 2.7.2 (released the 12 june 2011), and will be part of Python 3.2.1. |
|||
| msg139447 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2011年06月29日 18:56 | |
(Python 2.6 only accepts security fixes, no more bug fixes. It's time to upgrade to 2.7!) |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:19 | admin | set | github: 56652 |
| 2011年06月29日 18:56:30 | vstinner | set | messages: + msg139447 |
| 2011年06月29日 18:55:23 | vstinner | set | status: open -> closed nosy: + vstinner messages: + msg139446 resolution: duplicate |
| 2011年06月29日 18:51:16 | exarkun | create | |