[Python-Dev] test__locale weirdness

Brett C. bac at OCF.Berkeley.EDU
Wed Jul 14 03:25:19 CEST 2004


Nick Bastin wrote:
[SNIP - showing how locale.localeconv() is broken on OS X]
> int
> main (int argc, char *argv[])
> {
> struct lconv *result;
> 
> if (!setlocale(LC_NUMERIC, "fr_FR")) {
>   printf("setlocale() failed\n");
>   exit(1);
> }
> if (!( result = localeconv() )) {
>   printf("localeconv() failed\n");
>   exit(1);
> }
> 
> printf("Claimed locale:%s\n", setlocale(LC_NUMERIC, NULL));
> printf("decimal point: '%s', thousands_sep: '%s'\n", result->decimal_point,
> result->thousands_sep);
> 
> return 0;
> }
> 
> displays:
> 
> Claimed locale:fr_FR
> decimal point: ',', thousands_sep: ''
> 
> Which is exactly what you'd expect from a working implementation.  Does 
> anybody know what Python is doing beyond what this simple test does?
> 

In case anyone else is following/working on this, I stuck the C code 
shown above into the beginning of the module initialization function and 
it is wrong at that point already.

-Brett


More information about the Python-Dev mailing list