python-gnome: float weirdness with gnome.ui is back
reassign 119951 python-gnome, routeplanner-gnome
retitle 119951 python-gnome: float() works incorrectly after import gnome.ui
thanks
On Nov 17, Sebastian Rittau wrote:
> Package: routeplanner-gnome
> Version: 0.12
> Severity: important
>
> After starting the Gnome routeplanner frontend and trying to open
> /usr/share/routeplanner/Basic-USA.rpl3.gz I get the following stack
> trace on the console:
>
> srittau@jroger:~$ grplan
> Traceback (most recent call last):
[...]
> File "/usr/share/routeplanner/rpcity.py", line 36, in __init__
> self.longitude = float(data[2])
> ValueError: invalid literal for float(): 0.000
>
> The "Loading Cities" requester then hangs a 0%.
I've done some more tracking. Here's the interesting result:
$ LANG=de_DE@euro rpcli NorthAmerica.rpl3
* This works
$ LANG=de_DE@euro grplan NorthAmerica.rpl3
* This doesn't work
The reason:
"from gnome.ui import *" does something nasty to the locale settings
that stops float() from working. Python's float builtin (like int) is
supposed to work in the C locale all of the time; even if you do
locale.setlocale(LC_ALL, "") in a program, the only things that are
affected are in the locale module itself. Even doing "import gnome.ui"
triggers the bug.
I don't know what exactly is going on, but it's probably something in
python-gnome. I'm passing this along to its maintainer.
(Torsten: I suspect the fix for #59713 got rolled back somewhere along
the line, or something similar is going on elsewhere in the code.)
Chris
--
Chris Lawrence <cnlawren@olemiss.edu> - http://www.lordsutch.com/chris/
Instructor and Ph.D. Candidate, Political Science, Univ. of Mississippi
208 Deupree Hall - 662-915-5765
Reply to: