Bug 752316

Summary: [ja_JP] [RHSM CLI] repos module --help message_some strings displayed as question mark.
Product: Red Hat Enterprise Linux 5 Reporter: Lijun Li <lijli>
Component: subscription-managerAssignee: Adrian Likins <alikins>
Status: CLOSED CURRENTRELEASE QA Contact: IDM QE LIST <seceng-idm-qe-list>
Severity: high Docs Contact:
Priority: high    
Version: 5.8CC: alikins, bkearney, fsharath, jsefler, lijli, mkhusid, ndai, noriko, qe-i18n-bugs, smaitra
Target Milestone: rcKeywords: i18n
Target Release: 5.7   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: Improper handling of multi-byte unicode characters in a dependent library. Consequence: Some multi-byte unicode characters were not being rendered properly. Fix: subscription-manager overrode the incorrect handling of multi-byte characters by subclassing the dependent library. Result: All help strings are displayed properly.
Story Points: ---
Clone Of:
: 771751 820040 (view as bug list) Environment:
Last Closed: 2012-12-10 21:41:43 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 771751    
Bug Blocks: 771748, 807971, 820040    
Attachments:
Description Flags
RHSM CLI_repos module --help message_strings displayed as question mark_ja_JP none

Description Lijun Li 2011-11-09 07:10:37 UTC
Description of problem:
sudo subscription-manager repos --help message, some strings displayed as question mark.


Version-Release number of selected component (if applicable):
subscription-manager-0.96.17-1.el6


How reproducible:


Steps to Reproduce:
1.Run subscription-manager CLI in terminal
sudo subscription-manager repos --help
  
Actual results:
sudo subscription-manager repos --help message, some strings displayed as question mark.

Expected results:
All the strings should be displayed correctly.

Additional info:

Comment 2 Lijun Li 2011-11-09 07:15:36 UTC
Created attachment 532473 [details]
RHSM CLI_repos module  --help message_strings displayed as question mark_ja_JP

Comment 6 John Sefler 2011-11-09 15:02:56 UTC
Reconfirmation of this bug...
[root@jsefler-onprem-62server ~]# rpm -q subscription-manager
subscription-manager-0.96.17-1.el6.x86_64
[root@jsefler-onprem-62server ~]# LANG=ja_JP.UTF8 subscription-manager repos --help
使用法: subscription-manager repos [OPTIONS]

このマシンが使用権利を持つレポジトリの一覧表示

オプション:
  -h, --help  このヘルプメッセージを表示して終了
  --list      このシステム用に権利があるレポジトリの一覧
              ��示
              ^^ OFFENDING CHARACTERS

Comment 8 Adrian Likins 2011-11-09 15:30:24 UTC
The root cause of this looks to be a bug in the textwrap module in the main
python package. subscription-manager uses optparse, which uses textwrap to
help format help strings. It seems like textwrap is prone to splitting strings
in the middle of multibyte chars. 

(see https://code.launchpad.net/~songofacandy/bzr/i18n-utextwrap/+merge/59950
and http://mercurial.808500.n3.nabble.com/PATCH-replace-Python-standard-textwrap-by-MBCS-sensitive-one-for-i18n-text-td873814.html for examples of other folks running into this).

Comment 10 Lijun Li 2012-01-12 08:24:37 UTC
It's reproduced on subscription-manager-0.98.10-1.el5

Comment 12 Noriko Mizumoto 2012-03-21 00:02:43 UTC
Japanese and some other Asian languages are written in double width. There is nothing to do for translator. Here is the full translation for this string.

"このシステム用に権利があるレポジトリの一覧表示"

Comment 14 RHEL Program Management 2012-04-02 10:49:20 UTC
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux release.  Product Management has
requested further review of this request by Red Hat Engineering, for
potential inclusion in a Red Hat Enterprise Linux release for currently
deployed products.  This request is not yet committed for inclusion in
a release.

Comment 16 Adrian Likins 2012-05-29 13:10:58 UTC
> this commit fixes this bug, and is in master so headed for 5.9. This particular bug id wasn't included, but similar dupes were.

commit 775eda713fee3795b41e0ece1bb359ab9f841582
Author: Adrian Likins <alikins>
Date:   Wed May 9 11:39:29 2012 -0400

    820040,820037,820030: don't break multibyte help blurbs
    
    Add a optparse.HelpFormatter subclass that includes
    a version of format_option that does not try to split
    long words.This behavior is broken for multibyte cases.
    
    This includes code cut&paste from optparse.py in
    the python dist.

Comment 17 Sharath Dwaral 2012-06-20 18:31:24 UTC
Version

RHEL 5.9

# rpm -qa | grep subscription-manager
subscription-manager-migration-1.0.4-1.git.0.0fe81f8.el5
subscription-manager-1.0.4-1.git.0.0fe81f8.el5
subscription-manager-migration-data-1.11.1.1-1.git.2.c7fbafe.el5
subscription-manager-gui-1.0.4-1.git.0.0fe81f8.el5
subscription-manager-firstboot-1.0.4-1.git.0.0fe81f8.el5
[root@fsharath-rhel59server rhn]# rpm -qa | grep python-rhsm
python-rhsm-1.0.2-1.git.1.4659671.el5

Actual Result:
# LANG=ja_JP.UTF8 subscription-manager repos --help
使用法: subscription-manager repos [OPTIONS]

このマシンが使用権利を持つレポジトリの一覧表示

options:
  -h, --help        このヘルプメッセージを表示して終了
  --list            list known repos for this system
  --enable=REPOID   repo to enable
  --disable=REPOID  repo to disable

Expected Result:
All strings to be translated

Comments :

> Waiting for translations to be completed. 

> ON HOLD

Comment 19 Sharath Dwaral 2012-07-16 17:19:13 UTC
Version:

# rpm -qa | egrep "subscription-manager|python-rhsm"
subscription-manager-gui-1.0.9-1.git.4.59ef2fe.el5
python-rhsm-1.0.3-1.git.2.47dc8f4.el5
subscription-manager-migration-data-1.11.2.2-1.git.0.2eea155.el5
subscription-manager-migration-1.0.9-1.git.4.59ef2fe.el5
subscription-manager-firstboot-1.0.9-1.git.4.59ef2fe.el5
subscription-manager-1.0.9-1.git.4.59ef2fe.el5

Verification :

# LANG=ja_JP.UTF8 subscription-manager repos --help
使用法: 使用法: subscription-manager repos [オプション]

このマシンが使用権利を持つレポジトリの一覧表示

options:
  -h, --help        このヘルプメッセージを表示して終了
  --list            このシステム用の既知のレポジトリを一覧表示
  --enable=REPOID   有効にするレポジトリ
  --disable=REPOID  無効にするレポジトリ

Moving bug to VERIFIED

Comment 21 Bryan Kearney 2012-12-10 21:41:43 UTC
Bug Clean Up, these are in the current release.