Red Hat Bugzilla – Bug 219125
yum locale bug
Last modified: 2014-01-21 17:56:29 EST
Description of problem:
Yum crashes when working with C locale(e.g. within kyum). Found this bug after
upgrade to python-2.5 and yum-3.0.1 .
Version-Release number of selected component (if applicable):
yum info updates
Steps to Reproduce:
1. export LC_ALL=C
2. yum info updates
<some normal output>
Name : cups
Arch : i386
Epoch : 1
Size : 2.8 M
Repo : development
Summary: Common Unix Printing System
Traceback (most recent call last):
File "/usr/bin/yum", line 29, in <module>
File "/usr/share/yum-cli/yummain.py", line 102, in main
result, resultmsgs = do()
File "/usr/share/yum-cli/cli.py", line 359, in doCommands
return self.yum_cli_commands[self.basecmd].doCommand(self, self.basecmd,
File "/usr/share/yum-cli/yumcommands.py", line 167, in doCommand
base.listPkgs(ypl.updates, 'Updated Packages', basecmd)
File "/usr/share/yum-cli/output.py", line 110, in listPkgs
File "/usr/share/yum-cli/output.py", line 81, in infoOutput
print _("Description:\n%s") % pkg.returnSimple('description')
UnicodeEncodeError: 'ascii' codec can't encode character u'\xae' in position
88: ordinal not in range(128)
The package has a unicode character in its description and it can't be
represented with ascii.
LC_ALL=C is almost certainly *not* what you ever want; the OS is increasingly
dependent on being able to output and use unicode text. What are you trying to
achieve by using it?
> LC_ALL=C is almost certainly *not* what you ever want;
Yes, and my default locale is ru_RU.UTF-8, but kyum(yum frontend for kde from
fedora extras) sets his own(likely for his parsing of yum output). Imho yum
should catch exceptions like this and not to crash in any locale.
> > LC_ALL=C is almost certainly *not* what you ever want;
> Yes, and my default locale is ru_RU.UTF-8, but kyum(yum frontend for kde from
> fedora extras) sets his own(likely for his parsing of yum output).
This is a bug in kyum. Please file that it should be actually using the yum API
instead of trying to screen scrape. Alternately, using en_US.UTF-8 will be
better than C
> Imho yum
> should catch exceptions like this and not to crash in any locale.
The problem is that you _can't_ catch all of these. This is basically "anywhere
a string is used and printed".
Fundamentally, LC_ALL=C cannot work with a modern OS