Bug 1788922

Summary: dnf-plugins-extras fails to build with Python 3.9 due to rpmconf using removed open(..., "U") API
Product: [Fedora] Fedora Reporter: Miro Hrončok <mhroncok>
Component: rpmconfAssignee: Miroslav Suchý <msuchy>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: cstratak, dmach, jkadlcik, jmracek, mblaha, mhroncok, msuchy, pkratoch, rpm-software-management, vmukhame, xjakub
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rpmconf-1.0.21-1.fc31 rpmconf-1.0.21-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-01-27 11:25:41 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: 1785415    

Description Miro Hrončok 2020-01-08 11:35:46 UTC
dnf-plugins-extras fails to build with Python 3.9.0a2:

+ nosetests-3.9 -s tests/
...usage: dnf kickstart [-c [config file]] [-q] [-v] [--version]
                     [--installroot [path]] [--nodocs] [--noplugins]
                     [--enableplugin [plugin]] [--disableplugin [plugin]]
                     [--releasever RELEASEVER] [--setopt SETOPTS]
                     [--skip-broken] [-h] [--allowerasing] [-b | --nobest]
                     [-C] [-R [minutes]] [-d [debug level]] [--debugsolver]
                     [--showduplicates] [-e ERRORLEVEL] [--obsoletes]
                     [--rpmverbosity [debug level name]] [-y] [--assumeno]
                     [--enablerepo [repo]] [--disablerepo [repo] | --repo
                     [repo]] [--enable | --disable] [-x [package]]
                     [--disableexcludes [repo]] [--repofrompath [repo,path]]
                     [--noautoremove] [--nogpgcheck] [--color COLOR]
                     [--refresh] [-4] [-6] [--destdir DESTDIR]
                     [--downloadonly] [--comment COMMENT] [--bugfix]
                     [--enhancement] [--newpackage] [--security]
                     [--advisory ADVISORY] [--bz BUGZILLA] [--cve CVES]
                     [--sec-severity {Critical,Important,Moderate,Low}]
                     [--forcearch ARCH]
                     filename
dnf kickstart: error: unrecognized arguments: path2.ks
.......E............S..............................
======================================================================
ERROR: test_diff_output (tests.test_rpmconf.TestRpmConf)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/dnf-plugins-extras-4.0.8/tests/test_rpmconf.py", line 200, in test_diff_output
    rpmconf.run()
  File "/builddir/build/BUILDROOT/dnf-plugins-extras-4.0.8-1.fc32.x86_64/usr/lib/python3.9/site-packages/dnf-plugins/rpm_conf.py", line 80, in transaction
    rconf.run()
  File "/usr/lib/python3.9/site-packages/rpmconf/rpmconf.py", line 97, in run
    tested_files += self._handle_package(pkg_hdr)
  File "/usr/lib/python3.9/site-packages/rpmconf/rpmconf.py", line 316, in _handle_package
    self._show_cond_diff(conf_rpmnew, conf_file, conf_rpmnew)
  File "/usr/lib/python3.9/site-packages/rpmconf/rpmconf.py", line 203, in _show_cond_diff
    self.show_diff(file1, file2)
  File "/usr/lib/python3.9/site-packages/rpmconf/rpmconf.py", line 174, in show_diff
    fromlines = open(file1, "U").readlines()
ValueError: invalid mode: 'U'

----------------------------------------------------------------------
Ran 53 tests in 0.515s

FAILED (SKIP=1, errors=1)



New in Python 3.9:


open(), io.open(), codecs.open() and fileinput.FileInput no longer accept 'U' (“universal newline”) in the file mode. This flag was deprecated since Python 3.3. In Python 3, the “universal newline” is used by default when a file is open in text mode. The newline parameter of open() controls how universal newlines works. See https://bugs.python.org/issue37330



For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.9/fedora-rawhide-x86_64/01141165-dnf-plugins-extras/

For all our attempts to build dnf-plugins-extras with Python 3.9, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.9/package/dnf-plugins-extras/

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.9:
https://copr.fedorainfracloud.org/coprs/g/python/python3.9/

Let us know here if you have any questions.

Python 3.9 will be included in Fedora 33, but the initial bootstrapping has already started.
A build failure this early in the bootstrap sequence blocks us very much.

Comment 1 Miro Hrončok 2020-01-14 19:07:42 UTC
Upstream pull request: https://github.com/xsuchy/rpmconf/pull/38

Comment 2 Fedora Update System 2020-01-16 21:57:15 UTC
FEDORA-EPEL-2020-8f1078f2f9 has been submitted as an update to Fedora EPEL 8. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2020-8f1078f2f9

Comment 3 Fedora Update System 2020-01-16 21:57:16 UTC
FEDORA-2020-9515d2a837 has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2020-9515d2a837

Comment 4 Fedora Update System 2020-01-18 00:10:37 UTC
rpmconf-1.0.21-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-8f1078f2f9

Comment 5 Fedora Update System 2020-01-18 01:44:01 UTC
rpmconf-1.0.21-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-9515d2a837

Comment 6 Fedora Update System 2020-01-27 11:25:41 UTC
rpmconf-1.0.21-1.fc31 has been pushed to the Fedora 31 stable repository. If problems still persist, please make note of it in this bug report.

Comment 7 Fedora Update System 2020-02-02 01:36:04 UTC
rpmconf-1.0.21-1.el8 has been pushed to the Fedora EPEL 8 stable repository. If problems still persist, please make note of it in this bug report.