funny behaviour gtk+python

Simon McVittie simon.mcvittie at collabora.co.uk
Thu Oct 4 09:44:08 EDT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, 04 Oct 2007 at 14:23:58 +0100, 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:
...
>        tmpVal = (MYFLT) strtod(s, &tmp);

strtod() respects the process' locale settings. Importing gtk probably
pulls in the locale settings from the environment and sets them as the
process-wide locale (see setlocale(3)).

GLib has a function g_ascii_strtod(), and Python has PyOS_ascii_strtod
(which is actually the same function). csound ought to be using something
equivalent to this to parse locale-independent decimals, rather than
using the C library's strtod().

See http://www.python.org/dev/peps/pep-0331/ for more details.

	Simon
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: OpenPGP key: http://www.pseudorandom.co.uk/2003/contact/ or pgp.net

iD8DBQFHBO4nWSc8zVUw7HYRApmNAKCtSHLfE9bfJHfqu25fJ9aQgsic/QCg5ms5
YRG/YUnLEyXQ16mEq+IA87w=
=NArL
-----END PGP SIGNATURE-----



More information about the Devel mailing list