Description of problem: "yum info updates" crashes on when there is an update for some packages, like cups or selinux, when the summary have the symbol for "Registered Trademark". Version-Release number of selected component (if applicable): 3.1.6-1.fc7 How reproducible: Always. Steps to Reproduce: 1. yum info updates Actual results: UnicodeDecodeError: 'ascii' codec can't decode byte... Additional info: Changing line 73 in /usr/share/yum-cli/output.py as below solves the problem. print _("Description:\n%s") % pkg.description.encode("utf-8")
What locale are you running in?
LANG=en_US.iso88591 Actually, it don't matter: after some tests, both UTF-8 and iso8859-1 really works, not showing the error, but, "yum info cups | more", that was I always doing, give the error. And, in this "more" case, the encode("UTF-8") thing doesn't help...
This is the same bug that I have noticed with KYum, and there is a bz about this pending that is being ignored. Who's actually at fault?
The problem is: get_file_encoding(sys.stdout) normally is "UTF-8", but when stdout is redirected, we have "None". /me forcing UTF-8 in __init__.py: import sys import codecs sys.stdout = codecs.getwriter('utf-8')(sys.stdout) sys.stdin = codecs.getwriter('utf-8')(sys.stdin)
Okay, I could reproduce this the other day and now I can't. [root@erebor yum]# LANG=en_US.iso88591 python ./yummain.py info cups |more Loading "installonlyn" plugin Installed Packages Name : cups Arch : x86_64 Epoch : 1 Version: 1.2.10 Release: 6.fc7 Size : 8.6 M Repo : installed Summary: Common Unix Printing System Description: The Common UNIX Printing System provides a portable printing layer for UNIX� operating systems. It has been developed by Easy Software Products to promote a standard printing solution for all UNIX vendors and users. CUPS provides the System V and Berkeley command-line interfaces. Are you still able to reproduce it?
Yes... and no: # echo $LANG en_US.iso88591 # yum info cups | more Loading "changelog" plugin ...some stuff omitted... UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 88: ordinal not in range(128) # yum clean all # yum info cups ==> OK # yum clean all # yum info cups | more ==> surprise, it worked! Yum downloading some (package info|metadata) with stdout redirected were leading to error, but i can't reproduce it anymore... I didn't see any change that could have fixed this, i'm confused...
New rhpl should be in tomorrow's rawhide that addresses some things like this. But I don't see how that would ever come into play with yum. Can you give the full traceback? I might be able to decipher then where we're doing something wrong. Or at least try
After some time without updates to those specific packages, today's update choked up on policycoreutils. Full traceback: # yum info updates | less Loading "changelog" plugin Loading "installonlyn" plugin Excluding Packages in global exclude list Finished Updated Packages *** Traceback (most recent call last): *** File "/usr/bin/yum", line 29, in <module> *** yummain.main(sys.argv[1:]) *** File "/usr/share/yum-cli/yummain.py", line 94, in main *** result, resultmsgs = base.doCommands() *** File "/usr/share/yum-cli/cli.py", line 263, in doCommands *** return self.yum_cli_commands[self.basecmd].doCommand(self, self.basecmd, self.extcmds) *** 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 102, in listPkgs *** self.infoOutput(pkg) *** File "/usr/share/yum-cli/output.py", line 73, in infoOutput *** print _("Description:\n%s") % pkg.description *** UnicodeEncodeError: 'ascii' codec can't encode character u'\xae' in position 62: ordinal not in range(128)
this is fixed up in yum 3.2.1 or 3.2.2 in fedora 7 please give them a try.