RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 890296 - 'ascii' codec can't encode character u'\u2013'.
Summary: 'ascii' codec can't encode character u'\u2013'.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: subscription-manager
Version: 6.4
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: rc
: ---
Assignee: candlepin-bugs
QA Contact: IDM QE LIST
URL:
Whiteboard:
Depends On:
Blocks: 771481 rhsm-rhel70 895654
TreeView+ depends on / blocked
 
Reported: 2012-12-26 08:58 UTC by Liu Song
Modified: 2013-02-21 09:06 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-02-21 09:06:03 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:0350 0 normal SHIPPED_LIVE subscription-manager bug fix and enhancement update 2013-02-20 20:53:35 UTC

Description Liu Song 2012-12-26 08:58:57 UTC
Description of problem:
'ascii' codec can't encode character u'\u2013'.

Version-Release number of selected component (if applicable):
RHEL6.4 Beta
RHEL5.9 RC3.0

How reproducible:
100%

Steps to Reproduce:
1.Config the /etc/rhsm/rhsm.conf to use Stage candlepin:
hostname = subscription.rhn.stage.redhat.com

2.Register system with stage_test_40:
[root@unused Desktop]# subscription-manager register --type=RHUI
Username: stage_test_40
Password: 
The system has been registered with id: 99f04861-865b-4798-be68-c586a74d4b2b

3.Subscribe subscription which name is "Red Hat Update Infrastructure - Content Service – for Providers":
[root@unused Desktop]# subscription-manager list --available
+-------------------------------------------+
    Available Subscriptions
+-------------------------------------------+
Subscription Name:    	Red Hat Update Infrastructure - Content Service – for
                        Providers
SKU:                  	RC0295129
Pool Id:              	8a99f9833a7a39f2013a8c062a857580
Quantity:             	1997
Service Level:        	Premium
Service Type:         	L1-L3
Multi-Entitlement:    	No
Ends:                 	12/31/2012
System Type:          	Physical
(too long to snip other subscription)

[root@unused Desktop]# subscription-manager subscribe --pool=8a99f9833a7a39f2013a8c062a857580
Successfully attached a subscription for: Red Hat Update Infrastructure - Content Service – for Providers
[priority,] message string

4.Parse the entitlement cert with rct:
[root@unused Desktop]# ls /etc/pki/entitlement/
3304333259503416155-key.pem  3304333259503416155.pem

[root@unused Desktop]# rct cat-cert /etc/pki/entitlement/3304333259503416155.pem
Traceback (most recent call last):
  File "/usr/bin/rct", line 44, in <module>
    sys.exit(abs(main() or 0))
  File "/usr/bin/rct", line 39, in main
    return RctCLI().main()
  File "/usr/share/rhsm/subscription_manager/cli.py", line 157, in main
    return cmd.main()
  File "/usr/share/rhsm/rct/commands.py", line 44, in main
    return_code = self._do_command()
  File "/usr/share/rhsm/rct/commands.py", line 92, in _do_command
    skip_products=self.options.no_products)
  File "/usr/share/rhsm/rct/printing.py", line 196, in printc
    printer.printc(cert)
  File "/usr/share/rhsm/rct/printing.py", line 105, in printc
    print self.cert_to_str(cert)
  File "/usr/share/rhsm/rct/printing.py", line 166, in cert_to_str
    order_printer.as_str(cert.order), "\n".join(s))
  File "/usr/share/rhsm/rct/printing.py", line 47, in as_str
    s.append("\t%s: %s" % (_("Name"), xstr(order.name)))
  File "/usr/share/rhsm/rct/printing.py", line 26, in xstr
    return str(value)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2013' in position 48: ordinal not in range(128)

Actual results:
1.After step3,output is "Successfully attached a subscription...".However,throw out error message "[priority,] message string"following.
2.After step4,rct parse entitlment cert failed.

Expected results:
1.After step3,subscribe the subscription successfully,no error message pop.
2.After step4,rct can parse entitlement successfully.

Additional info:

Comment 2 RHEL Program Management 2012-12-30 06:47:51 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 7 Bryan Kearney 2013-01-04 20:10:42 UTC
commit a2914b46bd1e4151d4a6c3c0d237b63f083e1fd6
Author: Bryan Kearney <bkearney>
Date:   Wed Jan 2 14:03:31 2013 -0500

    890296: Unicode characters with a - are causing printing issues for rct printing

Comment 10 John Sefler 2013-01-07 22:20:01 UTC
Verifying Version...
[root@jsefler-6 ~]# rpm -q subscription-manager
subscription-manager-1.1.19-1.el6.x86_64

NOT DEMONSTRATED: setup a subscription with a name containing a UTF8 character –

[root@jsefler-6 ~]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+

Subscription Name:    	Subscription name containing UTF–8 character \u2013
Provides:             	
SKU:                  	utf8-subscription-sku
Contract:             	1554692394
Account:              	237306038
Serial Number:        	6545107459946795696
Active:               	True
Quantity Used:        	1
Service Level:        	
Service Type:         	
Starts:               	01/06/2013
Ends:                 	01/22/2013

[root@jsefler-6 ~]# rct cat-cert /etc/pki/entitlement/6545107459946795696.pem 

+-------------------------------------------+
	Entitlement Certificate
+-------------------------------------------+

Certificate:
	Path: /etc/pki/entitlement/6545107459946795696.pem
	Version: 3.1
	Serial: 6545107459946795696
	Start Date: 2013-01-06 21:49:06+00:00
	End Date: 2013-01-22 21:49:06+00:00

Subject:
	CN: 8a90f81d3c159143013c16fd5d930cdd


Order:
	Name: Subscription name containing UTF–8 character \u2013
	Number: 8a90f81d3c159143013c16fd06f50cb7
	SKU: utf8-subscription-sku
	Contract: 1554692394
	Account: 237306038
	Service Level: 
	Service Type: 
	Quantity: 20
	Quantity Used: 1
	Socket Limit: 
	RAM Limit: 
	Virt Limit: 
	Virt Only: False
	Subscription: 
	Stacking ID: 
	Warning Period: 0
	Provides Management: False

[root@jsefler-6 ~]# 


VERIFIED: rct cat-cert properly parses an entitlement containing UTF8 character –

Comment 12 errata-xmlrpc 2013-02-21 09:06:03 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


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