Message88932
In the Library Reference section 22.2.1 for locale, it states:
"Initially, when a program is started, the locale is the C locale, no
matter what the user’s preferred locale is. The program must explicitly
say that it wants the user’s preferred locale settings by calling
setlocale(LC_ALL, '')."
This is the case for python2.x:
$ export LANG=en_US.UTF-8
$ python2.5
Python 2.5.4 (r254:67916, Feb 17 2009, 20:16:45)
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale; locale.getlocale()
(None, None)
>>> locale.getdefaultlocale()
('en_US', 'UTF8')
>>>
but not for 3.1:
$ python3.1
Python 3.1a1+ (py3k, Mar 23 2009, 00:12:12)
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale; locale.getlocale()
('en_US', 'UTF8')
>>> locale.getdefaultlocale()
('en_US', 'UTF8')
>>>
Either the code is incorrect in 3.1 or the documentation should be
updated. |
|
Date |
User |
Action |
Args |
2009-06-05 10:56:39 | ned.deily | set | recipients:
+ ned.deily, georg.brandl |
2009-06-05 10:56:38 | ned.deily | set | messageid: <1244199398.44.0.399320307295.issue6203@psf.upfronthosting.co.za> |
2009-06-05 10:56:37 | ned.deily | link | issue6203 messages |
2009-06-05 10:56:36 | ned.deily | create | |
|