[Yum-devel] yum.i18n issues

Luke Macken lmacken at redhat.com
Mon May 5 19:53:58 UTC 2008


So I recently ran into a problem with some test cases for another project, caused
by yum overriding the builtin '_' and replacing it with the yum.i18n.dummy_wrapper.
One of the libraries I am using then tried to pass a 'domain' argument to
'_', thus triggering an exception, since the dummy_wrapper does not take
any arguments.

The yum.i18n module runs gettext.translation.install(), which ideally
should only be used for applications[0], not modules[1].

So, a potential solution would be to define '_' in the i18n module,
by doing something like this:

    t = gettext.translation('yum', fallback=True)
    _ = t.ugettext

And import '_' from it where necessary.

What do you guys think?


[0]: http://docs.python.org/lib/node739.html
[1]: http://docs.python.org/lib/node738.html

More information about the Yum-devel mailing list