Message7198

Author Arfrever
Recipients Arfrever
Date 2012-06-09.19:17:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1339269422.57.0.142198203691.issue1915@psf.upfronthosting.co.za>
In-reply-to
Content
Locale is set without call to locale.setlocale(). This issue occurs in both Jython 2.5 and 2.7.

$ export LC_ALL="pl_PL.UTF-8"
$ python2.5 -c 'import time; print(time.strftime("%d %b %Y", time.gmtime(time.time())))'
09 Jun 2012
$ python2.7 -c 'import time; print(time.strftime("%d %b %Y", time.gmtime(time.time())))'
09 Jun 2012
$ jython2.5 -c 'import time; print(time.strftime("%d %b %Y", time.gmtime(time.time())))'
09 cze 2012
$ jython2.7 -c 'import time; print(time.strftime("%d %b %Y", time.gmtime(time.time())))'
09 cze 2012

In CPython, locale specified in environmental variables is used only after call to locale.setlocale() with locale argument set to empty string:
$ python2.5 -c 'import locale, time; locale.setlocale(locale.LC_ALL, ""); print(time.strftime("%d %b %Y", time.gmtime(time.time())))'
09 cze 2012
$ python2.7 -c 'import locale, time; locale.setlocale(locale.LC_ALL, ""); print(time.strftime("%d %b %Y", time.gmtime(time.time())))'
09 cze 2012
History
Date User Action Args
2012-06-09 19:17:02Arfreversetrecipients: + Arfrever
2012-06-09 19:17:02Arfreversetmessageid: <1339269422.57.0.142198203691.issue1915@psf.upfronthosting.co.za>
2012-06-09 19:17:02Arfreverlinkissue1915 messages
2012-06-09 19:17:02Arfrevercreate