GTK breaks float! (related to "float does not parse 0.00000E+00")

Peter Mueller pmueller at decrc.abb.de
Tue Jun 6 10:57:25 EDT 2000


Hi,

it looks like that I have the same problem. I use the pickler. When I import
gtk/pygnome modules, the pickler can't read my pickled object (containing
floats) anymore.
This behaviour is new since redhat 6.2. On redhat 6.1 the same code with the
same pickled object works without any problem. The python versions on both
redhat 6.1/6.2 are the same. There must be a difference one of the modules.

Peter

Remco Gerlich wrote:

> Paolo Redaelli wrote in comp.lang.python:
> > Look at the this short program:
> >
> > =======
> > #!/usr/bin/env python
> >
> > s = "0.000000E+00"
> > print "Converting",s," into: ", float(s)
> > print "Importing gtk"
> >
> > import GDK
> > from gtk import *
> > from gnome.ui import *
> > import GdkImlib
> > print "Converting",s," into: ", float(s)
> > =======
> > Here's its output:
> > =======
> > [paolo at aldebaran paolo]$ python float.py
> > Converting 0.000000E+00  into:  0.0
> > Importing gtk
> > Converting 0.000000E+00  into:
> > Traceback (innermost last):
> >   File "float.py", line 11, in ?
> >     print "Converting",s," into: ", float(s)
> > ValueError: invalid literal for float(): 0.000000E+00
> > =======
> >
> > The only lesson I can extract from it is that GTK breaks float!
>
> It still looks to me like gtk or gnome.ui is overwriting float, because of
> your from module import * statements. What does "print repr(float)" say?
>
> (I don't have gtk, can't test this myself).
>
> --
> Remco Gerlich,  scarblac at pino.selwerd.nl
> This space intentionally left blank.




More information about the Python-list mailing list