funny behaviour gtk+python

Victor Lazzarini Victor.Lazzarini at
Thu Oct 4 09:36:07 EDT 2007

Just to add a  little to say that this particular csound error is
issued when there is an incorrect numeric format, say
11.B or 11.1A. In here, if I only use integers, there is
no error, but all decimals are raising the error. Here's the
Csound code fragment that issues the error:

static int constndx(CSOUND *csound, const char *s)
     MYFLT   newval;
     int     h, n, prv;

       volatile MYFLT  tmpVal;   /* make sure it really gets rounded to 
       char            *tmp = (char*) s;
       tmpVal = (MYFLT) strtod(s, &tmp);
       newval = tmpVal;
       if (tmp == s || *tmp != (char) 0) {
         synterr(csound, Str("numeric syntax '%s'"), s);
         return 0;



Somehow the 'strtod'  conversion is getting it wrong.

But why only after 'import gtk', I cannot understand.


At 13:12 04/10/2007, Victor Lazzarini wrote:
>(OLPC build 602)
>I have been trying a few things here and I stumbled
>across a funny problem (this is quite specialised, so
>I suppose only a few of you would know):
>1. With Python, if I do
>import gtk
>import csnd
>cs = csnd.Csound()
>the csound compilation will fail with very unusual
>syntax errors (which are not syntax errors at all)
>(eg: "error: numeric syntax "11.1", line ...")
>2. If I don't do
>import gtk
>Csound will happily compile my code.
>Now this seems so weird that I can't understand
>why it is happening.
>Any clues why "import gtk" is causing this

Victor Lazzarini
Music Technology Laboratory
Music Department
National University of Ireland, Maynooth

More information about the Devel mailing list