On Saturday 22 March 2008 14:51:45 victor wrote: > It has come to my attention that Csound has a potentially > problematic issue with orc/score parsing related to > the use of strtod(). I'll summarise the best I can: > > 1. This issue has popped up when using the Python > wrappers and the GTK library (PyGTK) on Linux in > the XO computer > > 2. The importing of the GTK module seems to change the > default locale. IMO this is a very grave bug in GTK's part. There is absolutely no reason for a library to change the locale. Has this been reported there? > > 3. strtod() in otran.c line 883 fails to translate real numeric > constants and the "numeric syntax" message is issued. > Compilation fails. > > 4. Other calls to strtod() in libcsound might also fail. I came > across one such failure in linevent.c line 301. > > 5. The interim solution has been to call > locale.setlocale(LC_ALL, "C") to set the locale back to "C" > before compilation (this is a wrapper to the c function > setlocale()). It would be nice to check which specific env var affects strtod's behaviour. LC_ALL is just a shortcut to set all LC_* variables. I guess that LC_CTYPE, LC_NUMERIC or LC_COLLATE are the variables that may change it. > > The question is: should we fix this inside the Csound library? > How should we be dealing with this issue? If the exact variable can be narrowed down, it could be set at compile time: store the old value, set the C locale, compile, restore the old value. > > Victor -- Felipe Sateler