Description of problem: dnf.rpm.detect_releasever() is behaving differently under Python2 and Python3. The difference is on this line: https://github.com/rpm-software-management/dnf/blob/6517f47c94bdf2da2b1ce11605babee4d8cb8756/dnf/rpm/__init__.py#L49 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): dnf-2.7.5-10.fc29.noarch dnf-conf-2.7.5-10.fc29.noarch dnf-plugins-core-2.1.5-4.fc28.noarch dnf-yum-2.7.5-10.fc29.noarch libdnf-0.11.1-3.fc28.x86_64 python2-dnf-2.7.5-10.fc29.noarch python3-dnf-2.7.5-10.fc29.noarch python3-dnf-plugins-core-2.1.5-4.fc28.noarch How reproducible: always 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("/")' rawhide 3. Under python3 I see: # python3 -c 'import dnf; print(dnf.rpm.detect_releasever("/"))' 29 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.