Bug 800323

Summary: Unicode characters break subscription-manager when executed from a subshell
Product: Red Hat Enterprise Linux 6 Reporter: Tomas Strachota <tstrachota>
Component: subscription-managerAssignee: Alex Wood <awood>
Status: CLOSED ERRATA QA Contact: Entitlement Bugs <entitlement-bugs>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.4CC: alikins, awood, ddumas, jsefler
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-21 08:54:12 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:    
Bug Blocks: 771481, 888457    
Attachments:
Description Flags
Setting default output stream encoding to utf-8
none
Encoding of url params none

Description Tomas Strachota 2012-03-06 10:13:29 UTC
Description of problem:

Any subscription-manager action that is run against a system with orgs and envs containing international characters fails. It's most likely caused by Python's output encoding that set to 'ascii' by default.


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


Steps to Reproduce:
1. install katello, create org and env with international chars
2. set subscription-manager against that server
3. echo "$(subscription-manager orgs --username=admin --password=admin)"


Actual results:
'ascii' codec can't encode character u'\u017e' in position XXX: ordinal not in range(128)

Expected results:
It should print data normally.

Comment 2 Bryan Kearney 2012-03-07 20:01:33 UTC
This is fixed in the latest subscription-manager. No change was required when using 0.99.X. QA, can you verify?

Comment 3 Tomas Strachota 2012-03-15 15:28:10 UTC
Created attachment 570325 [details]
Setting default output stream encoding to utf-8

It is still not working in our katello system tests with the latest version of subscription-manager. I have two patches that fixed the problem for me.

Comment 4 Tomas Strachota 2012-03-15 15:30:59 UTC
Created attachment 570326 [details]
Encoding of url params

A patch for python-rhsm that fixes using i18n names in url params. Probably not the cleanest one.

Comment 6 Alex Wood 2012-12-05 20:13:47 UTC
Tomas,

I was able to reproduce the error you are receiving when running a command in a subshell.  The patch provided in comment 3 does fix the issue for me.

However, I'm wondering about the patch in comment 4.  Can you give me a scenario to test it with?

I tried the following, but everything worked correctly.

  1. Create organization in Katello with international characters in the name.
  2. Create an environment for that organization.
  3. Run subscription-manager environments --org=$name_from_step_1

Comment 7 Alex Wood 2012-12-06 18:06:00 UTC
commit 056e69dc833919709bbf23d8a7b73a5345f77fdf
Author: Alex Wood <awood>
Date:   Wed Dec 5 15:46:57 2012 -0500

    800323: Set default output stream encoding to UTF-8.

Comment 10 John Sefler 2012-12-12 20:28:38 UTC
Verifying Version...
[root@jsefler-6 ~]# rpm -q subscription-manager
subscription-manager-1.1.14-1.el6.x86_64
CloudForms System Engine Version: 1.1.12-22.el6cf 

After configuring my system to communicate with CFSE, and creating a organization and environment on the CDSE, I can now use subscription-manager to query the availablilty of orgs and envs as follows...


[root@jsefler-6 ~]# subscription-manager orgs --username=admin
Password: 
+-------------------------------------------+
          admin Organizations
+-------------------------------------------+

Name: 	項目
Key: 	orglabel

Name: 	ACME_Corporation
Key: 	ACME_Corporation

[root@jsefler-6 ~]# subscription-manager environments --username=admin --org=項目
Password: 
+-------------------------------------------+
          Environments
+-------------------------------------------+
Name:                 	理者
Description:        


^^^ VERIFIED: The international characters used for an organization name and an environment name where properly displayed in the subscription-manager output.

Moving bugzilla status to VERIFIED

Comment 12 errata-xmlrpc 2013-02-21 08:54:12 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.

http://rhn.redhat.com/errata/RHBA-2013-0350.html

Comment 13 John Sefler 2013-05-28 15:10:44 UTC
Note: The subject of this bug has been re-visited for subscription-manager-1.8 in bug 919584
See https://bugzilla.redhat.com/show_bug.cgi?id=919584#c7