[Python-Dev] test__locale weirdness (original) (raw)

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(LCNUMERIC, "frFR")) { printf("setlocale() failed\n"); exit(1); } if (!( result = localeconv() )) { printf("localeconv() failed\n"); exit(1); } printf("Claimed locale:%s\n", setlocale(LCNUMERIC, NULL)); printf("decimal point: '%s', thousandssep: '%s'\n", result->decimalpoint, result->thousandssep); return 0; } displays: Claimed locale:frFR decimal point: ',', thousandssep: '' 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