Bug 219125 - yum locale bug
yum locale bug
Status: CLOSED CANTFIX
Product: Fedora
Classification: Fedora
Component: yum (Show other bugs)
rawhide
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jeremy Katz
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-12-11 04:51 EST by Gennadi Sushko
Modified: 2014-01-21 17:56 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-12-11 14:39:22 EST
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 Gennadi Sushko 2006-12-11 04:51:36 EST
Description of problem:
Yum crashes when working with C locale(e.g. within kyum). Found this bug after 
upgrade to python-2.5 and yum-3.0.1 .

Version-Release number of selected component (if applicable):

yum-3.0.1-3.fc7
python-2.5-2.fc7


How reproducible:

export LC_ALL=C
yum info updates


Steps to Reproduce:
1. export LC_ALL=C
2. yum info updates
3.
  
Actual results:
<some normal output>

Name   : cups
Arch   : i386
Epoch  : 1
Version: 1.2.7
Release: 6.fc7
Size   : 2.8 M
Repo   : development
Summary: Common Unix Printing System
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 102, in main
    result, resultmsgs = do()
  File "/usr/share/yum-cli/cli.py", line 359, 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 110, in listPkgs
    self.infoOutput(pkg)
  File "/usr/share/yum-cli/output.py", line 81, in infoOutput
    print _("Description:\n%s") % pkg.returnSimple('description')
UnicodeEncodeError: 'ascii' codec can't encode character u'\xae' in position 
88: ordinal not in range(128)
Comment 1 Jeremy Katz 2006-12-11 13:43:06 EST
The package has a unicode character in its description and it can't be
represented with ascii.  

LC_ALL=C is almost certainly *not* what you ever want; the OS is increasingly
dependent on being able to output and use unicode text.  What are you trying to
achieve by using it?
Comment 2 Gennadi Sushko 2006-12-11 14:21:09 EST
> LC_ALL=C is almost certainly *not* what you ever want;

Yes, and my default locale is ru_RU.UTF-8, but kyum(yum frontend for kde from 
fedora extras) sets his own(likely for his parsing of yum output). Imho yum 
should catch exceptions like this and not to crash in any locale.
Comment 3 Jeremy Katz 2006-12-11 14:39:22 EST
> > LC_ALL=C is almost certainly *not* what you ever want;
> 
> Yes, and my default locale is ru_RU.UTF-8, but kyum(yum frontend for kde from 
> fedora extras) sets his own(likely for his parsing of yum output). 

This is a bug in kyum.  Please file that it should be actually using the yum API
instead of trying to screen scrape.  Alternately, using en_US.UTF-8 will be
better than C

> Imho yum 
> should catch exceptions like this and not to crash in any locale.

The problem is that you _can't_ catch all of these.  This is basically "anywhere
a string is used and printed".

Fundamentally, LC_ALL=C cannot work with a modern OS

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