Bug 245498

Summary: crash of yum info (UnicodeEncodeError) but ONLY with redirected output
Product: [Fedora] Fedora Reporter: Allan Engelhardt <allane>
Component: yumAssignee: Jeremy Katz <katzj>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 7CC: james.antill
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: 3.2.1-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-06-24 13:11:59 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Allan Engelhardt 2007-06-24 12:33:23 UTC
Description of problem:

Running 

$ yum info aterm.x86_64

from a gnome-terminal works fine, but

$ yum info aterm.x86_64 > /dev/null

crashes with the error message

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)



Version-Release number of selected component (if applicable): yum-3.2.0-1.fc7


How reproducible: Every time.  I tried using tee(1) but that also barfs.


Steps to Reproduce:
1. yum info aterm.x86_64 > /dev/null
2.
3.
  
Actual results: (as above)


Expected results: No error, and 'yum info aterm.x86_64 > /tmp/foo && cat
/tmp/foo' should provide the same result as 'yum info aterm.x86_64'.


Additional info:

$ rpm -qa | grep yum | sort
yum-3.2.0-1.fc7
yumex-1.9.9-1.0.fc7
yum-fastestmirror-1.1.5-1.fc7
yum-kernel-module-1.1.5-1.fc7
yum-metadata-parser-1.1.0-2.fc7
yum-metadata-parser-debuginfo-1.1.0-2.fc7
yum-updatesd-3.2.0-1.fc7
yum-utils-1.1.5-1.fc7

$ locale
LANG=en_GB.UTF-8
LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC="en_GB.UTF-8"
LC_TIME="en_GB.UTF-8"
LC_COLLATE="en_GB.UTF-8"
LC_MONETARY="en_GB.UTF-8"
LC_MESSAGES="en_GB.UTF-8"
LC_PAPER="en_GB.UTF-8"
LC_NAME="en_GB.UTF-8"
LC_ADDRESS="en_GB.UTF-8"
LC_TELEPHONE="en_GB.UTF-8"
LC_MEASUREMENT="en_GB.UTF-8"
LC_IDENTIFICATION="en_GB.UTF-8"
LC_ALL=

$ LANG="C" yum info aterm.x86_64 > /tmp/foo # also gives error

The offending character is almost certainly the "´" in the second line description:

$ yum info aterm.x86_64
Name   : aterm
Arch   : x86_64
Version: 1.0.0
Release: 7.fc7
Size   : 123 k
Repo   : fedora
Summary: Afterstep XVT, VT102 emulator for the X Window system
Description:
aterm, version 1.00 is a colour vt102 terminal emulator, based on
rxvt 2.4.8 with Alfredo Kojima´s additions of fast transparency,
intended as an xterm(1) replacement for users who do not require fea-
tures such as Tektronix 4014 emulation and toolkit-style configurabil-
ity. As a result, aterm uses much less swap space -- a significant
advantage on a machine serving many X sessions.

Comment 1 Allan Engelhardt 2007-06-24 13:11:59 UTC
Fixed in the testing version (yum-3.2.1-1.fc7).

(It would be nice if Bugzilla searched recently-closed bugs by default)