Bug#602471: pymca: package unusable
Teemu Ikonen
tpikonen at gmail.com
Thu Nov 11 16:36:32 UTC 2010
Hello Armando,
On Wed, Nov 10, 2010 at 4:58 PM, "V. Armando Solé" <sole at esrf.fr> wrote:
> I have made the specfile module insensitive to the LC_NUMERIC locale when
> used in POSIX systems but I really do not know if that is better than
> forcing myself the locale in PyMca just after instantiating QApplication.
>
> Building specfile with the SPECFILE_POSIX flag, uses an atof replacement
> function that reads current LC_NUMERIC locale, changes it to C, performs
> atof and restores the LC_NUMERIC locale. The problem is that it can be made
> thousands of times when reading a file.
>
> Building specfile with the PYMCA_POSIX flag, does the same thing but outside
> the loop over all the lines of the file.
>
> In my case, I have foreseen to use the PYMCA_POSIX flag when building
> specfile within PyMca and SPECFILE_POSIX flag when building the specfile
> module as an standalone. You can take a look at the main PyMca setup.py file
> and at the ./specfile/setup.py file.
>
> Please let me know if you consider that a cleaner solution.
I would say that setting and unsetting the locale in the atof call is
a bit too heavy, so the 'PYMCA_POSIX flag' solution sounds better to
me.
On the other hand, if you already have an atof function in PyMca, why
not use one which parses the string independent of locale. Simple
implementations can be easily found with google code search, but their
reliability and speed is of course not guaranteed. Apparently both
Python and Perl do not use the libc atof, so code borrowed from them
would not be completely untested.
Best,
Teemu
More information about the debian-science-maintainers
mailing list