[Tutor] gettext mystery

Kent Johnson kent_johnson at skillsoft.com
Sat Nov 6 00:44:47 CET 2004


I don't know why you get a different gettext depending on when you import 
it...maybe something is being added to sys.path?
You might be able to get it to work by deleting the gtk-1.2/gettext.py so 
all imports find the standard version. If the newer one is backwards 
compatible I think this will work.

Kent

At 12:05 AM 11/5/2004 +0100, Michael Lange wrote:
>On Thu, 04 Nov 2004 12:04:15 -0500
>Kent Johnson <kent_johnson at skillsoft.com> wrote:
>
> > If you print gettext.__file__ it will show you where it was loaded 
> from. If
> > you are loading two different modules that will show them you you.
> >
> > Kent
> >
>Thanks, Kent
>
>that's it; version  1:
>
>[pingu at localhost pingu]$ moleskine
>/usr/lib/python2.2/site-packages/gtk-1.2/gettext.py
>
>version 2:
>
>[pingu at localhost pingu]$ moleskine
>/usr/lib/python2.2/gettext.pyc
>
>a simple RPM request shows that the (here) first gettext module is from my 
>pygnome install.
>
>I wonder now if there is a way to force the import of the standard library 
>module instead
>of pygnome's, which looks like it might be an outdated version of the 
>standard library gettext.py .
>I tried to change sys.path and found that it actually worked to do a 
>sys.path.sort() before
>importing gettext, but this doesn't look to me like it's the way it should 
>be done.
>
>What's the recommended way to change the order of the module search path.
>
>Thanks for any hints
>
>Michael
>
>
>_______________________________________________
>Tutor maillist  -  Tutor at python.org
>http://mail.python.org/mailman/listinfo/tutor



More information about the Tutor mailing list