Bug 1519512

Summary: Package profile upload failed if rpm vendor contains latin character
Product: Red Hat Enterprise Linux 7 Reporter: Hao Chang Yu <hyu>
Component: subscription-managerAssignee: Kevin Howell <khowell>
Status: CLOSED ERRATA QA Contact: Red Hat subscription-manager QE Team <rhsm-qe>
Severity: high Docs Contact: Filip Hanzelka <fhanzelk>
Priority: high    
Version: 7.4CC: csnyder, fhanzelk, hyu, jhnidek, jsefler, jstavel, khowell, mdekan, mkalyat, salmy, skallesh
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: subscription-manager-1.20.10-1 Doc Type: Release Note
Doc Text:
*subscription-manager* reports an *RPM* package if its vendor contains non-UTF8 characters Previously, the *subscription-manager* utility assumed UTF-8 data in the *RPM* package vendor field. Consequently, if an *RPM* installed on the system contained a vendor with non-UTF8 characters, the *subscription-manager* failed to report the packages. With this update, the *subscription-manager* has been updated to ignore encoding issues in the *RPM* package vendor field. As a result, *subscription-manager* reports a package profile correctly even if the installed *RPM* has a non-UTF8 vendor.
Story Points: ---
Clone Of:
: 1544768 (view as bug list) Environment:
Last Closed: 2018-04-10 09:52:44 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1544768    

Description Hao Chang Yu 2017-11-30 19:45:12 UTC
Getting the following error when the vendor of rpm contains latin character.

Description of problem:
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.6/json/__init__.py", line 230, in dumps
    return _default_encoder.encode(obj)
  File "/usr/lib64/python2.6/json/encoder.py", line 367, in encode
    chunks = list(self.iterencode(o))
  File "/usr/lib64/python2.6/json/encoder.py", line 309, in _iterencode
    for chunk in self._iterencode_dict(o, markers):
  File "/usr/lib64/python2.6/json/encoder.py", line 275, in _iterencode_dict
    for chunk in self._iterencode(value, markers):
  File "/usr/lib64/python2.6/json/encoder.py", line 294, in _iterencode
    yield encoder(o)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xf6 in position 9: invalid start byte

0xf6 is 'รถ' in latin character.

[1] https://docs.python.org/2/library/json.html
json.dumps(obj, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, cls=None, indent=None, separators=None, encoding="utf-8", default=None, sort_keys=False, **kw)

Based on the above documentation, the default encoding for json.dumps is 'utf8'.

Comment 3 Chris Snyder 2017-12-04 15:27:05 UTC
What version of subscription-manager and python-rhsm are being used here?

Comment 4 Michal Dekan 2017-12-11 09:42:18 UTC
(In reply to Chris Snyder from comment #3)
> What version of subscription-manager and python-rhsm are being used here?

Checking sosreport from RHEL6 client in attached case, these packages are installed:


Comment 10 Jan Stavel 2018-02-13 19:10:20 UTC
Hello everybody I am wondering how a simple testscenarion looks like to verify this case.

Comment 18 errata-xmlrpc 2018-04-10 09:52:44 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.