Bug#602471: pymca: package unusable
V. Armando Solé
sole at esrf.fr
Wed Nov 10 15:58:36 UTC 2010
On 08/11/2010 18:08, Teemu Ikonen wrote:
> Thanks for debugging this. I can reproduce the bug by starting pymca with
> LANG=de_DE.UTF-8 pymca
> Interestingly, instantiating QApplication class makes the scanf call
> in the specfile module use the locale-based numeric format. See the
> attached testcase.
> The quick and dirty fix would be to add the line
> export LC_NUMERIC=C
> as a second or third line to /usr/bin/pymca
> But, there is probably a smarter way to fix this.
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
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.
More information about the debian-science-maintainers