Bug 466093 - 'yum repolist' does not show all enabled repos
'yum repolist' does not show all enabled repos
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: yum (Show other bugs)
rawhide
All Linux
medium Severity low
: ---
: ---
Assigned To: Seth Vidal
Fedora Extras Quality Assurance
: Patch
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-10-08 06:07 EDT by Michal Schmidt
Modified: 2014-01-21 18:06 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-10-08 08:45:23 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)
decode the utf-8 string returned by locale.format (602 bytes, patch)
2008-10-08 06:07 EDT, Michal Schmidt
no flags Details | Diff

  None (edit)
Description Michal Schmidt 2008-10-08 06:07:18 EDT
Created attachment 319739 [details]
decode the utf-8 string returned by locale.format

Description of problem:
'yum repolist' does not show that I have the standard 'rawhide' repo enabled. It's completely missing in 'yum repolist all' output too.
The problem is locale-dependent. I use cs_CZ.UTF-8. 'LANG=C yum repolist' works fine.

Version-Release number of selected component (if applicable):
yum-3.2.19-3.fc10.noarch

How reproducible:
100%

Steps to Reproduce:
1. Make sure you have enabled a repo with at least 1000 packages (e.g. Rawhide).
2. LANG=cs_CZ.UTF-8 yum repolist all
  
Actual results:
Notice that the repo is not listed. A traceback can be seen with -d6 or more:
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 229, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 104, in main
    result, resultmsgs = base.doCommands()
  File "/usr/share/yum-cli/cli.py", line 339, in doCommands
    return self.yum_cli_commands[self.basecmd].doCommand(self, self.basecmd, self.extcmds)
  File "/usr/share/yum-cli/yumcommands.py", line 716, in doCommand
    base.fmtKeyValFill(_("Repo-pkgs   : "), ui_num),
  File "/usr/share/yum-cli/output.py", line 308, in fmtKeyValFill
    initial_indent=key, subsequent_indent=nxt)
  File "/usr/lib64/python2.5/textwrap.py", line 315, in fill
    return w.fill(text)
  File "/usr/lib64/python2.5/textwrap.py", line 287, in fill
    return "\n".join(self.wrap(text))
  File "/usr/lib64/python2.5/textwrap.py", line 278, in wrap
    return self._wrap_chunks(chunks)
  File "/usr/lib64/python2.5/textwrap.py", line 258, in _wrap_chunks
    lines.append(indent + ''.join(cur_line))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 2: ordinal not in range(128)


Expected results:
yum should list all repos.

Additional info:
I found the bug. 'yum repolist' wants to print the count of packages in the repo. In the Czech locale the thousands separator is a no-break space character. This character is not in ASCII.
I propose the following patch.
Comment 1 James Antill 2008-10-08 08:45:23 EDT
 I didn't see the patch, but I've pushed a fix upstream which fixes it for me:

http://yum.baseurl.org/gitweb?p=yum.git;a=commitdiff;h=41e82de38ac39291193abc15725212145b898aa6

...it'll get into Fedora 10.

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