Bug 436143 - "yum info all" error
"yum info all" error
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: yum (Show other bugs)
rawhide
i386 Linux
low Severity low
: ---
: ---
Assigned To: Seth Vidal
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-03-05 11:39 EST by Horst H. von Brand
Modified: 2014-01-21 18:02 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-03-12 12:53:38 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Horst H. von Brand 2008-03-05 11:39:26 EST
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 11:41:02 EST
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 12:21:35 EST
What locale are you running as?
Comment 3 James Antill 2008-03-05 12:23:45 EST
LANG=de_DE yum info checkpolicy

...fails for me.
Comment 4 James Antill 2008-03-05 12:27:14 EST
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 12:43:46 EST
 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 13:15:15 EST
 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 16:58:56 EST
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 12:53:38 EDT
closing as fixed upstream as I believe it is.

Note You need to log in before you can comment on or make changes to this bug.