Bug 436143

Summary: "yum info all" error
Product: [Fedora] Fedora Reporter: Horst H. von Brand <vonbrand>
Component: yumAssignee: Seth Vidal <skvidal>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: rawhideCC: ffesti, james.antill, katzj, pmatilai, tim.lauridsen
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-03-12 16:53:38 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 Horst H. von Brand 2008-03-05 16:39:26 UTC
Description of problem:
Running "yum info all" gives:

Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in <module>
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/share/yum-cli/yummain.py", line 236, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 111, in main
    result, resultmsgs = base.doCommands()
  File "/usr/share/yum-cli/cli.py", line 309, in doCommands
    return self.yum_cli_commands[self.basecmd].doCommand(self, self.basecmd,
self.extcmds)
  File "/usr/share/yum-cli/yumcommands.py", line 212, in doCommand
    rip = base.listPkgs(ypl.installed, _('Installed Packages'), basecmd)
  File "/usr/share/yum-cli/output.py", line 316, in listPkgs
    self.infoOutput(pkg)
  File "/usr/share/yum-cli/output.py", line 287, in infoOutput
    print self._outKeyValFill(_("Description: "), enc(pkg.description))
  File "/usr/lib/python2.5/codecs.py", line 303, in write
    data, consumed = self.encode(object, self.errors)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 62: ordinal
not in range(128)

Version-Release number of selected component (if applicable):
yum-3.2.12-3.fc9.noarch

How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Horst H. von Brand 2008-03-05 16:41:02 UTC
Last entry written was truncated:

Name       : checkpolicy
Arch       : i386
Version    : 2.0.10
Release    : 1.fc9
Size       : 791 k
Repo       : installed
Summary    : SELinux policy compiler
License    : GPL

Comment 2 Seth Vidal 2008-03-05 17:21:35 UTC
What locale are you running as?

Comment 3 James Antill 2008-03-05 17:23:45 UTC
LANG=de_DE yum info checkpolicy

...fails for me.


Comment 4 James Antill 2008-03-05 17:27:14 UTC
Although with a different traceback, and on the summary data (for both the Fed-8
and Fed-9 versions).


Comment 5 James Antill 2008-03-05 17:43:46 UTC
 So the problem is that the pkg.summary/pkg.description appear to be defined as
"ascii", even though they are actually utf-8 and contain ® etc.


Comment 6 James Antill 2008-03-05 18:15:15 UTC
 Ok, so I this fixes it for me:

diff --git a/output.py b/output.py
index 0b1498b..06bf1d6 100644
--- a/output.py
+++ b/output.py
@@ -276,6 +276,7 @@ class YumOutput:
                     if t != s:
                         s = t
                         break
+            s = unicode(s, "UTF-8")
             return s
         print _("Name       : %s") % pkg.name
         print _("Arch       : %s") % pkg.arch

...can you try that, Horst?


Comment 7 Horst H. von Brand 2008-03-05 21:58:56 UTC
Re 2: LANG=en_US.UTF-8
Re 6: Just tried again, no patches. Now it works! (?!) Only change is that I had
to reboot (for completely unrelated reasons) after updating today.

Comment 8 Seth Vidal 2008-03-12 16:53:38 UTC
closing as fixed upstream as I believe it is.