Bug 236434 - yum crash
Summary: yum crash
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: yum   
(Show other bugs)
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: James Antill
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-04-13 21:21 UTC by Florencio
Modified: 2014-01-21 22:57 UTC (History)
1 user (show)

Fixed In Version: 3.2.1-1.fc7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-08-03 20:16:43 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

Description Florencio 2007-04-13 21:21:00 UTC
Description of problem:

"yum info updates" crashes on when there is an update for some packages,
like cups or selinux, when the summary have the symbol for "Registered 
Trademark".


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

How reproducible:
Always.

Steps to Reproduce:
1. yum info updates


Actual results:
UnicodeDecodeError: 'ascii' codec can't decode byte...

Additional info:

Changing line 73 in /usr/share/yum-cli/output.py as below solves the problem. 

print _("Description:\n%s") % pkg.description.encode("utf-8")

Comment 1 Jeremy Katz 2007-04-16 15:52:08 UTC
What locale are you running in?

Comment 2 Florencio 2007-04-16 16:47:09 UTC
LANG=en_US.iso88591

Actually, it don't matter: after some tests, both UTF-8 and iso8859-1 really
works, not showing the error, but, "yum info cups | more", that was I always
doing, give the error. And, in this "more" case, the encode("UTF-8") thing
doesn't help...


Comment 3 G.Wolfe Woodbury 2007-04-18 13:06:41 UTC
This is the same bug that I have noticed with KYum, and there is a bz about this
pending that is being ignored.

Who's actually at fault?

Comment 4 Florencio 2007-04-19 22:44:51 UTC
The problem is:

get_file_encoding(sys.stdout) normally is "UTF-8", but when stdout is
redirected, we have "None".

/me forcing UTF-8 in __init__.py:

import sys
import codecs
sys.stdout = codecs.getwriter('utf-8')(sys.stdout)
sys.stdin = codecs.getwriter('utf-8')(sys.stdin)


Comment 5 Jeremy Katz 2007-04-25 16:58:02 UTC
Okay, I could reproduce this the other day and now I can't.

[root@erebor yum]# LANG=en_US.iso88591 python ./yummain.py  info cups |more
Loading "installonlyn" plugin
Installed Packages
Name   : cups
Arch   : x86_64
Epoch  : 1
Version: 1.2.10
Release: 6.fc7
Size   : 8.6 M
Repo   : installed
Summary: Common Unix Printing System

Description:
The Common UNIX Printing System provides a portable printing layer for
UNIX� operating systems. It has been developed by Easy Software Products
to promote a standard printing solution for all UNIX vendors and users.
CUPS provides the System V and Berkeley command-line interfaces.


Are you still able to reproduce it? 

Comment 6 Florencio 2007-04-25 23:08:16 UTC
Yes... and no:

# echo $LANG
en_US.iso88591
# yum info cups | more
Loading "changelog" plugin
...some stuff omitted...
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 88: 
ordinal not in range(128)

# yum clean all
# yum info cups ==> OK
# yum clean all
# yum info cups | more  ==> surprise, it worked!

Yum downloading some (package info|metadata) with stdout redirected were
leading to error, but i can't reproduce it anymore...
I didn't see any change that could have fixed this, i'm confused...


Comment 7 Jeremy Katz 2007-04-26 18:26:40 UTC
New rhpl should be in tomorrow's rawhide that addresses some things like this. 
But I don't see how that would ever come into play with yum.

Can you give the full traceback?  I might be able to decipher then where we're
doing something wrong.  Or at least try

Comment 8 Florencio 2007-05-18 01:53:13 UTC
After some time without updates to those specific packages, today's
update choked up on policycoreutils. Full traceback:

# yum info updates | less
Loading "changelog" plugin
Loading "installonlyn" plugin
Excluding Packages in global exclude list
Finished
Updated Packages
*** 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 263, in doCommands
***     return self.yum_cli_commands[self.basecmd].doCommand(self, 
self.basecmd, self.extcmds)
***   File "/usr/share/yum-cli/yumcommands.py", line 167, in doCommand
***     base.listPkgs(ypl.updates, 'Updated 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'\xae' in 
position 62: ordinal not in range(128)




Comment 9 Seth Vidal 2007-08-03 20:16:43 UTC
this is fixed up in yum 3.2.1 or 3.2.2 in fedora 7

please give them a try.


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