[Patches] [ python-Patches-405851 ] Allow jython to complete test_strftime

noreply@sourceforge.net noreply@sourceforge.net
Fri, 23 Mar 2001 11:54:07 -0800


Patches item #405851, was updated on 2001-03-04 09:36
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=405851&group_id=5470

Category: library
Group: None
Status: Open
Priority: 3
Submitted By: Finn Bock (bckfnn)
Assigned to: M.-A. Lemburg (lemburg)
Summary: Allow jython to complete test_strftime

Initial Comment:
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.

----------------------------------------------------------------------

>Comment By: Finn Bock (bckfnn)
Date: 2001-03-23 11:54

Message:
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.


----------------------------------------------------------------------

Comment By: Barry Warsaw (bwarsaw)
Date: 2001-03-23 09:25

Message:
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.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=405851&group_id=5470