Issue1915

classification
Title: Locale set without call to locale.setlocale()
Type: Severity: normal
Components: Versions: Jython 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Arfrever, fwierzbicki
Priority: normal Keywords:

Created on 2012-06-09.19:17:02 by Arfrever, last changed 2013-02-26.18:31:40 by fwierzbicki.

Messages
msg7198 (view) Author: Arfrever Frehtes Taifersar Arahesis (Arfrever) Date: 2012-06-09.19:17:02
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
2013-02-26 18:31:40fwierzbickisetpriority: normal
nosy: + fwierzbicki
versions: + Jython 2.7
2012-06-09 19:17:02Arfrevercreate