Bug 436143 - "yum info all" error
Summary: "yum info all" error
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: yum
Version: rawhide
Hardware: i386
OS: Linux
low
low
Target Milestone: ---
Assignee: Seth Vidal
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-03-05 16:39 UTC by Horst H. von Brand
Modified: 2014-01-21 23:02 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2008-03-12 16:53:38 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

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.


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