Message12358
The local month formatting behaviour is defined at the lowest possible level, for CPython in timemodule.c, calling into either wcsftime(), or the relevant OS-specific library.
In jython there is a reimplementation in org/python/modules/time/Time.java which calls into the Java standard libraries, understandably enough.
The definition of %b, is "Month as locale’s abbreviated name".
https://docs.python.org/2/library/datetime.html#strftime-and-strptime-behavior
https://docs.python.org/3.8/library/datetime.html#strftime-and-strptime-behavior
One practical if slightly work-avoiding position would be to say jython locales *are* Java locales. This would be a more defensible position if jython locale stuff wasn't weak (as generally admitted), eg if setlocale() wasn't broken (also noted by Wang Yaqiang)
https://sourceforge.net/p/jython/mailman/message/34586162/
Traceback (most recent call last):
File "showlocale.py", line 10, in <module>
locale.setlocale(locale.LC_ALL, 'de_DE')
File "C:\Users\Adam\jython\jython3\dist\Lib\locale.py", line 552, in setlocale
return _setlocale(category, locale)
File "C:\Users\Adam\jython\jython3\dist\Lib\locale.py", line 88, in setlocale
raise Error, '_locale emulation only supports "C" locale'
ValueError: _locale emulation only supports "C" locale
OTOH, you have to fix one thing at a time, and maintaining a Java-C locale mapping sounds like a thankless and moving-target task.
As a side note for anyone fishing in this area, jython has a fork of the datetime module, which doesn't do much except override add a few __tojava__() methods. Reorganizing that in an include / override structure would be good (but not actually address this issue at all). |
|
Date |
User |
Action |
Args |
2019-03-15 10:54:54 | adamburke | set | messageid: <1552647294.18.0.398477833912.issue2730@roundup.psfhosted.org> |
2019-03-15 10:54:54 | adamburke | set | recipients:
+ adamburke |
2019-03-15 10:54:54 | adamburke | link | issue2730 messages |
2019-03-15 10:54:53 | adamburke | create | |
|