Bug 905100

Summary: yum grouplist fails when customized locale in use
Product: Red Hat Enterprise Linux 6 Reporter: James B. Byrne <byrnejb>
Component: yumAssignee: Valentina Mukhamedzhanova <vmukhame>
Status: CLOSED ERRATA QA Contact: Marek Marusic <mmarusic>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.3CC: james.antill, jzeleny, mmarusic, tcallawa, vmukhame
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: yum-3.2.29-61.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-07-22 07:20:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description James B. Byrne 2013-01-28 15:22:25 UTC
Description of problem:

yum grouplist command fails with unknown locale error when a user defined locale is specified in the environment

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

3.2.29

How reproducible:

Always

Steps to Reproduce:
1. Define and compile custom locale
2. run 'yum grouplist'
3.
  
Actual results:

ValueError: unknown locale: en_CA

Expected results:

Shows list of yum package groups available

Additional info:

This is the automatically produced dump message:

Subject: [abrt] full crash report
User-Agent: Heirloom mailx 12.4 7/29/08
Content-Type: text/plain; charset=us-ascii
Status: R

abrt_version:   2.0.8
cmdline:        /usr/bin/python /usr/bin/yum grouplist installed
executable:     /usr/bin/yum
kernel:         2.6.32-279.19.1.el6.x86_64
reason:         locale.py:410:_parse_localename:ValueError: unknown locale: en_CA@yyyy
-mmm-dd.UTF-8
time:           Mon 28 Jan 2013 09:20:02  EST
uid:            0
username:       root

sosreport.tar.xz: Binary file, 761720 bytes

backtrace:
:locale.py:410:_parse_localename:ValueError: unknown locale: en_CA
:
: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 285, in user_main
:    errcode = main(args)
:  File "/usr/share/yum-cli/yummain.py", line 136, in main
:    result, resultmsgs = base.doCommands()
:  File "/usr/share/yum-cli/cli.py", line 438, in doCommands
:    return self.yum_cli_commands[self.basecmd].doCommand(self, self.basecmd, self.ext
cmds)
:  File "/usr/share/yum-cli/yumcommands.py", line 457, in doCommand
:    return base.returnGroupLists(extcmds)
:  File "/usr/share/yum-cli/cli.py", line 1215, in returnGroupLists
:    patterns=userlist)
:  File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 2810, in doGroupLists
:    case_sensitive=not ignore_case)
:  File "/usr/lib/python2.6/site-packages/yum/comps.py", line 433, in return_groups
:    for name in group.name, group.groupid, group.ui_name:
:  File "/usr/lib/python2.6/site-packages/yum/comps.py", line 48, in ui_name
:    return self.nameByLang(get_my_lang_code())
:  File "/usr/lib/python2.6/site-packages/yum/misc.py", line 1001, in get_my_lang_code
:    mylang = locale.getlocale(locale.LC_MESSAGES)
:  File "/usr/lib64/python2.6/locale.py", line 497, in getlocale
:    return _parse_localename(localename)
:  File "/usr/lib64/python2.6/locale.py", line 410, in _parse_localename
:    raise ValueError, 'unknown locale: %s' % localename
:ValueError: unknown locale: en_CA
:
:Local variables in innermost frame:
:code: 'en_CA'
:localename: 'en_CA'
:modifier: 'yyyy-mmm-dd.UTF-8'


This is the locale file info:

/usr/lib/locale/en_CA/LC_MESSAGES
/usr/lib/locale/en_CA@yyyy-mmm-dd/LC_MESSAGES
/usr/lib/locale/en_CA/LC_MESSAGES
/usr/lib/locale/en_CA/LC_MESSAGES
/usr/lib/locale/en_CA/LC_MESSAGES
/usr/lib/locale/en_CA/LC_MESSAGES

Comment 2 James Antill 2013-01-31 18:02:22 UTC
 This is already fixed upstream with:

commit 7738cfbffe3066fca4a6c8a514f9b56f09ab2eb3
Author: James Antill <james>
Date:   Fri May 27 16:24:34 2011 -0400

    Work around RHEL-5 python broken getlocale() call. BZ 708292

...just need to add it.

Comment 3 RHEL Program Management 2013-10-14 00:01:34 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unable to address this
request at this time.

Red Hat invites you to ask your support representative to
propose this request, if appropriate, in the next release of
Red Hat Enterprise Linux.

Comment 7 errata-xmlrpc 2015-07-22 07:20:59 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-1384.html