> Maths behave strangely after importing * from gtk:

   > >>> from math import sqrt, exp
   > >>> 4*exp(-.5)/sqrt(2.0)
   > 1.71552776992
   > >>> from gtk import *
   > >>> 4*exp(-.5)/sqrt(2.0)
   > 2,82842712475

It doesn't happen if LC_NUMERIC is set to "C" instead of "fr_FR".

Probably LC_NUMERIC should be set to "C" in gtkmodule.c after calling
gtk_set_locale():

#include <locale.h>

static PyObject *_wrap_gtk_set_locale(PyObject *self, PyObject *args)
{
    char *locale;

    if (!PyArg_ParseTuple(args, ":gtk_set_locale"))
        return NULL;
    locale = gtk_set_locale();
    setlocale(LC_NUMERIC, "C");
    return PyString_FromString(locale);
}

static PyMethodDef _gtkmoduleMethods[] = {
    { "gtk_set_locale", _wrap_gtk_set_locale, 1 },
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]

Reply via email to