Bug 1693767

Summary: Switch to a string for RPM calls (oncoming rpm API fix change)
Product: [Fedora] Fedora Reporter: Panu Matilainen <pmatilai>
Component: atomicAssignee: Lokesh Mandvekar <lsm5>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: adimania, amurdaca, bbaude, dwalsh, fkluknav, lsm5, walters
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-04-04 19:39:50 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:17:27 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 like atomic need fixing for the new behavior.

There's at least one place in atomic that is affected, there's an explicit .decode() in _get_rpms() function.

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:08 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 Daniel Walsh 2019-04-03 22:26:52 UTC
Atomic command is being dropped.

Comment 3 Daniel Walsh 2019-04-03 22:27:38 UTC
Lokesh how do I go about dropping a package from Fedora?

Comment 4 Panu Matilainen 2019-04-04 06:28:01 UTC
Daniel, see https://fedoraproject.org/wiki/How_to_remove_a_package_at_end_of_life

Comment 5 Daniel Walsh 2019-04-04 19:39:50 UTC
Package is retired.