reason? (was Re: funny behaviour gtk+python)

Victor Lazzarini Victor.Lazzarini at nuim.ie
Thu Oct 4 09:30:43 EDT 2007


would this be the reason?

https://bugs.launchpad.net/pygtk/+bug/27112

import gtk Changing the default encoding? Funny
I am not getting it on my other fedora systems (perhaps
because they are one version behind?).

Victor

At 14:23 04/10/2007, Victor Lazzarini wrote:
>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 
> MYFLT */
>       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.
>
>Victor
>
>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()
>>cs.Compile("myexample.csd")
>>
>>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
>>behaviour?
>>
>>thanks
>>
>>Victor

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




More information about the Devel mailing list