Bug 236434 - yum crash
yum crash
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: yum (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: James Antill
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-04-13 17:21 EDT by Florencio
Modified: 2014-01-21 17:57 EST (History)
1 user (show)

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


Attachments (Terms of Use)

  None (edit)
Description Florencio 2007-04-13 17:21:00 EDT
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 11:52:08 EDT
What locale are you running in?
Comment 2 Florencio 2007-04-16 12:47:09 EDT
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 09:06:41 EDT
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 18:44:51 EDT
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 12:58:02 EDT
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 19:08:16 EDT
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 14:26:40 EDT
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-17 21:53:13 EDT
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 16:16:43 EDT
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.