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 1052840 - The rct tool "cat-cert" module got a traceback when system environment language is not English.
Summary: The rct tool "cat-cert" module got a traceback when system environment langua...
Keywords:
Status: CLOSED DUPLICATE of bug 1048325
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: subscription-manager
Version: 7.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: candlepin-bugs
QA Contact: John Sefler
URL:
Whiteboard:
Depends On:
Blocks: rhsm-rhel70
TreeView+ depends on / blocked
 
Reported: 2014-01-14 07:50 UTC by xingge
Modified: 2016-09-20 02:28 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-01-15 13:35:24 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description xingge 2014-01-14 07:50:34 UTC
Description of problem:
The rct tool "cat-cert" module got a traceback when system environment language is not English

Version-Release number of selected component (if applicable):
subscription-manager-firstboot-1.10.10-1.el7.x86_64
subscription-manager-1.10.10-1.el7.x86_64
subscription-manager-gui-1.10.10-1.el7.x86_64
python-rhsm-1.10.10-1.el7.x86_64

How reproducible:
always

Steps to Reproduce:
1.Register the system and attach some subscriptions.
2.Run rct tool with cmd:
LANG=zh rct cat-cert /etc/pki/entitlement/***.pem

Actual results:
[root@dhcp-13-59 ~]# LANG=zh rct cat-cert /etc/pki/entitlement/8337640300296218469.pem 
Traceback (most recent call last):
  File "/usr/bin/rct", line 47, in <module>
    sys.exit(abs(main() or 0))
  File "/usr/bin/rct", line 42, in main
    return RctCLI().main()
  File "/usr/share/rhsm/subscription_manager/cli.py", line 166, in main
    return cmd.main()
  File "/usr/share/rhsm/rct/commands.py", line 39, in main
    return_code = self._do_command()
  File "/usr/share/rhsm/rct/cert_commands.py", line 76, in _do_command
    skip_products=self.options.no_products)
  File "/usr/share/rhsm/rct/printing.py", line 228, in printc
    printer.printc(cert)
  File "/usr/share/rhsm/rct/printing.py", line 124, in printc
    print self.cert_to_str(cert)
  File "/usr/share/rhsm/rct/printing.py", line 191, in cert_to_str
    return "%s\n%s%s" % (ProductCertificatePrinter.cert_to_str(self, cert),
  File "/usr/share/rhsm/rct/printing.py", line 172, in cert_to_str
    return "%s\n%s" % (CertificatePrinter.cert_to_str(self, cert), "\n".join(s))
  File "/usr/share/rhsm/rct/printing.py", line 118, in cert_to_str
    self._append_to_cert_section(cert, s)
  File "/usr/share/rhsm/rct/printing.py", line 198, in _append_to_cert_section
    str_parts_list.append("\t%s: %s" % (_("Pool ID"), pool_id))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 1: ordinal not in range(128)

Expected results:
The info of the entitlement cert should be shown.

Additional info:
1.Not only zh but also all other language will meet this traceback.
2.If I use a system that default lang is zh, the error message appears too.
3.The module state-cert works fine like below:
[root@dhcp-13-59 ~]# rct stat-cert /etc/pki/entitlement/8337640300296218469.pem 
Type: Entitlement Certificate
Version: 3.2
DER size: 1462b
Subject Key ID size: 20b
Content sets: 0
[root@dhcp-13-59 ~]# LANG=zh rct stat-cert /etc/pki/entitlement/8337640300296218469.pem 
类型:授权证书
版本:3.2
DER 大小:1462b
主题键 ID 大小:20b
内容:0

Comment 2 Adrian Likins 2014-01-14 17:23:11 UTC
LANG=zh is not a valid locale.

Try:

    LANG=zh_CN.utf8

Comment 3 xingge 2014-01-15 02:53:57 UTC
The results that I tried LANG=zh_CN.utf8. I just use LANG=*** to show the bug easily. I fact when I use rct cat-cert in a system which use zh_CN as default language the traceback shows too.

[root@dhcp-13-59 ~]# LANG=zh_CN.utf8 rct cat-cert /etc/pki/entitlement/8337640300296218469.pem 
Traceback (most recent call last):
  File "/usr/bin/rct", line 47, in <module>
    sys.exit(abs(main() or 0))
  File "/usr/bin/rct", line 42, in main
    return RctCLI().main()
  File "/usr/share/rhsm/subscription_manager/cli.py", line 166, in main
    return cmd.main()
  File "/usr/share/rhsm/rct/commands.py", line 39, in main
    return_code = self._do_command()
  File "/usr/share/rhsm/rct/cert_commands.py", line 76, in _do_command
    skip_products=self.options.no_products)
  File "/usr/share/rhsm/rct/printing.py", line 228, in printc
    printer.printc(cert)
  File "/usr/share/rhsm/rct/printing.py", line 124, in printc
    print self.cert_to_str(cert)
  File "/usr/share/rhsm/rct/printing.py", line 191, in cert_to_str
    return "%s\n%s%s" % (ProductCertificatePrinter.cert_to_str(self, cert),
  File "/usr/share/rhsm/rct/printing.py", line 172, in cert_to_str
    return "%s\n%s" % (CertificatePrinter.cert_to_str(self, cert), "\n".join(s))
  File "/usr/share/rhsm/rct/printing.py", line 118, in cert_to_str
    self._append_to_cert_section(cert, s)
  File "/usr/share/rhsm/rct/printing.py", line 198, in _append_to_cert_section
    str_parts_list.append("\t%s: %s" % (_("Pool ID"), pool_id))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 1: ordinal not in range(128)

Comment 4 John Sefler 2014-01-15 13:24:48 UTC
I believe this is a dup of bug 1048325

Comment 5 Carter Kozak 2014-01-15 13:35:24 UTC
You are correct.  The fix is in master, I'll probably do a build in the next day or so.

*** This bug has been marked as a duplicate of bug 1048325 ***


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