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.

classification
Title: Allow jython to complete test_strftime
Type: Stage:
Components: Library (Lib) Versions:
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: lemburg Nosy List: barry, bckfnn, lemburg
Priority: low Keywords: patch

Created on 2001-03-04 17:36 by bckfnn, last changed 2022-04-10 16:03 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
l bckfnn, 2001-03-04 17:36 The patch
405851.txt barry, 2001-03-23 17:25
Messages (4)
msg35989 - (view) Author: Finn Bock (bckfnn) * (Python triager) Date: 2001-03-04 17:36
Java always eun with a national locale. As a result 
the default strings from the "time" module is 
national. This path will assign a US locale and allow 
a successful test even when running with a non-us 
computer.
msg35990 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2001-03-23 17:25
Logged In: YES 
user_id=12800

A couple of notes, then assignment back to Finn for
determination.  First, it seems to me that Jython ought to
supply an _locale module for compatibility with CPython. 
That way, test_strftime.py could simply "import locale" and
then do a locale.setlocale() without testing the platform.

Second, it seems that Java has no "C" locale, but for
CPython, the strftime tests require specifically "C" locale
and not "en_US" locale (the latter of which breaks the
tests).  So, what is the right thing to do here?

I'm attaching an alternative patch which ought to work
today.  Finn, please comment and I'll apply it for Python
2.1 final if it looks okay.

Since Finn's not a CPython developer, I'm assigning the
patch to MAL for a sanity check on the locale issues.  MAL,
feel free to assign back to me if my changes make sense.
msg35991 - (view) Author: Finn Bock (bckfnn) * (Python triager) Date: 2001-03-23 19:54
Logged In: YES 
user_id=4201

Yes, Jython should have a locals _module but the locale 
categories makes little sense in java. Since a jython 
_locale module would be a very weak emulation of C I think 
it would be acceptable to make setlocale(LC_ALL, "C") mean 
java.util.Locale.US.

OTOH your patch works fine for my test run of jython.
msg35992 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2001-03-23 20:23
Logged In: YES 
user_id=12800

Okay, cool.  In that case, I'll commit just this change for
2.1b2.  test_strftime.py 1.25.

Assigning away from MAL and closing (although he's more than
welcome to comment :)
History
Date User Action Args
2022-04-10 16:03:48adminsetgithub: 34059
2001-03-04 17:36:56bckfnncreate