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.

Author ned.deily
Recipients georg.brandl, ned.deily
Date 2009-06-05.10:56:36
SpamBayes Score 5.3398586e-10
Marked as misclassified No
Message-id <1244199398.44.0.399320307295.issue6203@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2009-06-05 10:56:39ned.deilysetrecipients: + ned.deily, georg.brandl
2009-06-05 10:56:38ned.deilysetmessageid: <1244199398.44.0.399320307295.issue6203@psf.upfronthosting.co.za>
2009-06-05 10:56:37ned.deilylinkissue6203 messages
2009-06-05 10:56:36ned.deilycreate