Description of problem:
dnf.rpm.detect_releasever() is behaving differently under Python2 and Python3. The difference is on this line:
where hdr[rpm.RPMTAG_PROVIDENAME] returns a list of strings under Python2, but a list of bytes under Python3, and therefore the following .index(distroverpkg) doesn't match anything.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. I have modified fedora-release to have an extra provide:
# rpm -q --provides fedora-release | grep releasever
system-release(releasever) = rawhide
2. Under python2 I see:
# python -c 'import dnf; print dnf.rpm.detect_releasever("/")'
3. Under python3 I see:
# python3 -c 'import dnf; print(dnf.rpm.detect_releasever("/"))'
After modifying the python3 dnf source, the hdr[rpm.RPMTAG_PROVIDENAME] contains:
[b'config(fedora-release)', b'fedora-release', b'fedora-release-nonproduct', b'fedora-release-standard', b'redhat-release', b'system-release', b'system-release(29)', b'system-release(releasever)']
And the caught exception is:
ValueError("'system-release(releasever)' is not in list",)
I created a patch https://github.com/rpm-software-management/dnf/pull/1062
The issue is solved by dnf-3.0.1-1 that was released into rawhide.