[Tutor] gettext mystery

Michael Lange klappnase at freenet.de
Fri Nov 5 00:05:58 CET 2004


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




More information about the Tutor mailing list