Bug 1693788 - rebase-helper: Switch to a string for RPM calls (oncoming rpm API fix change)
Summary: rebase-helper: Switch to a string for RPM calls (oncoming rpm API fix change)
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: rebase-helper
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Nikola Forró
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1693751 1779194
TreeView+ depends on / blocked
 
Reported: 2019-03-28 15:56 UTC by Panu Matilainen
Modified: 2019-12-03 13:47 UTC (History)
3 users (show)

Fixed In Version: rebase-helper-0.16.3-1.fc30 rebase-helper-0.16.3-1.fc28 rebase-helper-0.16.3-1.fc29
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-05-28 01:09:48 UTC
Type: Bug


Attachments (Terms of Use)

Description Panu Matilainen 2019-03-28 15:56:17 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 one place in rebase-helper that is affected, there's a hardcoded .decode('utf-8') call in get_info_from_rpm() 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:54 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 Fedora Update System 2019-05-16 13:26:23 UTC
rebase-helper-0.16.3-1.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-5e3fcd2e94

Comment 3 Fedora Update System 2019-05-16 13:26:28 UTC
rebase-helper-0.16.3-1.fc30 has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-93270968e7

Comment 4 Fedora Update System 2019-05-16 13:26:34 UTC
rebase-helper-0.16.3-1.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2019-94dd5c7caf

Comment 5 Fedora Update System 2019-05-17 02:20:42 UTC
rebase-helper-0.16.3-1.fc28 has been pushed to the Fedora 28 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-2019-94dd5c7caf

Comment 6 Fedora Update System 2019-05-17 03:48:44 UTC
rebase-helper-0.16.3-1.fc29 has been pushed to the Fedora 29 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-2019-5e3fcd2e94

Comment 7 Fedora Update System 2019-05-17 15:37:50 UTC
rebase-helper-0.16.3-1.fc30 has been pushed to the Fedora 30 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-2019-93270968e7

Comment 8 Fedora Update System 2019-05-28 01:09:48 UTC
rebase-helper-0.16.3-1.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.

Comment 9 Fedora Update System 2019-05-28 01:17:19 UTC
rebase-helper-0.16.3-1.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.

Comment 10 Fedora Update System 2019-05-28 02:00:41 UTC
rebase-helper-0.16.3-1.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.


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