Bug 1693787

Summary: tracer: Switch to a string for RPM calls (oncoming rpm API fix change)
Product: [Fedora] Fedora Reporter: Panu Matilainen <pmatilai>
Component: tracerAssignee: Jakub Kadlčík <jkadlcik>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 31CC: jkadlcik, laurent.rineau__fedora, sokeeffe
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tracer-0.7.4-1.fc32 tracer-0.7.4-1.fc31 tracer-0.7.4-1.el7 tracer-0.7.4-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-06-19 01:02:18 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:
Embargoed:
Bug Depends On:    
Bug Blocks: 1693751, 1779194    

Description Panu Matilainen 2019-03-28 15:54:07 UTC
Description of problem:

Rpm's python3 API has been totally braindamaged all this time but people are only noticing now that it's starting to get used. 

We're changing rpm to return all string data as surrogate-escaped utf-8 python strings everywhere (instead of bytes with unknown encoding that the API doesn't otherwise even accept, see bug 1631292). This makes most rpm-scripts written for python2 just work with python3 too (from the rpm pov).

Most software that has kept python2 compatibility are automatically compatible with the fixed API, but unfortunately python3-only users need fixing for the new behavior.

There are at least two places in tracker that are affected, there are hardcoded .decode('utf-8') calls in _file_provided_by() and load_package_info() functions.

As the broken rpm versions are widely in use, it's best to keep compatibility with both initially. Basically replace all the hardcoded .decode("utf-8") calls to header data with something like this:

def b2s(data):
    if isinstance(data, bytes):
        return data.decode('utf-8')
    return data

Comment 1 Panu Matilainen 2019-03-29 07:09:45 UTC
I was pointed out that the bug referred to in the message is a private RHEL bug, sorry about that. 
The public, Fedora side counterpart with the background story is the one blocked by this, ie 
https://bugzilla.redhat.com/show_bug.cgi?id=1693751

Comment 2 Ben Cotton 2019-08-13 16:57:07 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to '31'.

Comment 3 Ben Cotton 2019-08-13 19:26:40 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to 31.

Comment 4 Fedora Update System 2020-06-08 04:10:33 UTC
FEDORA-EPEL-2020-140d0e644a has been submitted as an update to Fedora EPEL 8. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2020-140d0e644a

Comment 5 Fedora Update System 2020-06-08 04:10:33 UTC
FEDORA-2020-2e33457aa0 has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2020-2e33457aa0

Comment 6 Fedora Update System 2020-06-08 04:10:34 UTC
FEDORA-EPEL-2020-89299cdfbe has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2020-89299cdfbe

Comment 7 Fedora Update System 2020-06-08 04:10:36 UTC
FEDORA-2020-8847397947 has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2020-8847397947

Comment 8 Fedora Update System 2020-06-11 18:19:47 UTC
tracer-0.7.4-1.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2020-89299cdfbe

Comment 9 Fedora Update System 2020-06-11 19:20:37 UTC
tracer-0.7.4-1.fc32 has been pushed to the Fedora 32 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-8847397947

Comment 10 Fedora Update System 2020-06-11 19:23:29 UTC
tracer-0.7.4-1.fc31 has been pushed to the Fedora 31 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-2e33457aa0

Comment 11 Fedora Update System 2020-06-11 19:24:14 UTC
tracer-0.7.4-1.el8 has been pushed to the Fedora EPEL 8 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2020-140d0e644a

Comment 12 Fedora Update System 2020-06-19 01:02:18 UTC
FEDORA-2020-8847397947 has been pushed to the Fedora 32 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 13 Fedora Update System 2020-06-23 01:12:35 UTC
FEDORA-2020-2e33457aa0 has been pushed to the Fedora 31 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 14 Fedora Update System 2020-06-26 00:35:46 UTC
FEDORA-EPEL-2020-89299cdfbe has been pushed to the Fedora EPEL 7 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 15 Fedora Update System 2020-06-26 01:52:08 UTC
FEDORA-EPEL-2020-140d0e644a has been pushed to the Fedora EPEL 8 stable repository.
If problem still persists, please make note of it in this bug report.