Description of problem: If text to be printed in an RPM file contains a non-ASCII character and yum's output is redirected to a pipe or file, yum crashes. Version-Release number of selected component (if applicable): yum-3.2.0-1.fc7 How reproducible: Always (with the right RPM). E.g. the RPM for aterm-1.0.0-7.fc7 contains an ACUTE ACCENT (#00B4). Steps to Reproduce: 1. yum info aterm | less OR yum info aterm > file 2. 3. Actual results: # yum info aterm > @i 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 264, in doCommands return self.yum_cli_commands[self.basecmd].doCommand(self, self.basecmd, self.extcmds) File "/usr/share/yum-cli/yumcommands.py", line 165, in doCommand base.listPkgs(ypl.available, 'Available 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'\xb4' in position 109: ordinal not in range(128) The file @i contains everything up to the line with the non-ASCII character. Expected results: Nice output. Additional info: My locale ($LANG) is en_US.UTF-8. Perhaps this is a bug in (in this case) aterm if RPMs aren't allowed to contain non-ASCII?
Fixed upstream for yum 3.2.1
*** Bug 242341 has been marked as a duplicate of this bug. ***
*** Bug 244571 has been marked as a duplicate of this bug. ***
yum-3.2.1-1.fc7 has been pushed to the Fedora 7 testing repository. If problems still persist, please make note of it in this bug report.
yum-3.2.1-1.fc7 has been pushed to the Fedora 7 stable repository. If problems still persist, please make note of it in this bug report.
New yum behaves even worse, now it crashes at first available description and it doesn't even matter if the output is redirected to file. In other words, "yum info" stopped worked under any conditions. $ yum info Loading "installonlyn" plugin Loading "fedorakmod" plugin Installed Packages Name : ConsoleKit Arch : x86_64 Version: 0.2.1 Release: 2.fc7 Size : 118 k Repo : installed 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 266, in doCommands return self.yum_cli_commands[self.basecmd].doCommand(self, self.basecmd, self.extcmds) File "/usr/share/yum-cli/yumcommands.py", line 164, in doCommand base.listPkgs(ypl.installed, 'Installed Packages', basecmd) File "/usr/share/yum-cli/output.py", line 102, in listPkgs self.infoOutput(pkg) File "/usr/share/yum-cli/output.py", line 72, in infoOutput print _("Summary: %s") % pkg.summary.encode("UTF-8") UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 0: ordinal not in range(128) My guess is "ConsoleKit" description is in utf-8 encoded string already. Trying to "encode" it to utf-8 is meaningless operation, only unicode string can be "encoded". At least some hack like if isinstance(pkg.summary, unicode): print _("Summary: %s") % pkg.summary.encode("UTF-8") else: print _("Summary: %s") % pkg.summary # assuming it's in utf-8, not some other obscure encoding is needed, but the problem should be fought at its roots, so that there is a guarantee that pkg.summary is always a unicode string.
A simple way to reproduce the new problem is yum info checkpolicy The problem is that the first line of the description contains the Unicode equivalent of (R) which is presumably what causes the crash.
Original case is fixed here, the other case is being tracked with bug 245445
This is still an issue with yum-3.2.1-1.fc7 and the ticket should be re-opened. Also reported as Bug 248078 . On Fedora 7 x86_64: # rpm -q yum yum-3.2.1-1.fc7 # yum info cups.x86_64 Loading "fastestmirror" plugin Loading "kernel-module" plugin Loading "installonlyn" plugin Loading mirror speeds from cached hostfile livna 100% |=========================| 2.1 kB 00:00 fedora 100% |=========================| 2.1 kB 00:00 updates-debuginfo 100% |=========================| 1.9 kB 00:00 fedora-debuginfo 100% |=========================| 1.9 kB 00:00 updates 100% |=========================| 1.9 kB 00:00 moertel-community 100% |=========================| 951 B 00:00 Installed Packages Name : cups Arch : x86_64 Epoch : 1 Version: 1.2.11 Release: 2.fc7 Size : 8.8 M Repo : installed Summary: Common Unix Printing System 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 266, in doCommands return self.yum_cli_commands[self.basecmd].doCommand(self, self.basecmd, self.extcmds) File "/usr/share/yum-cli/yumcommands.py", line 164, in doCommand base.listPkgs(ypl.installed, 'Installed 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.encode("UTF-8") UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 75: ordinal not in range(128) No updates in testing: # yum --enablerepo=updates-testing update yum Loading "fastestmirror" plugin Loading "kernel-module" plugin Loading "installonlyn" plugin Loading mirror speeds from cached hostfile Setting up Update Process Could not find update match for yum No Packages marked for Update/Obsoletion
(Proposed patch attached to Bug 248078)
*** Bug 249462 has been marked as a duplicate of this bug. ***