Bug 2019017

Summary: python-iniparse fails to build with Python 3.11: AttributeError: 'RawConfigParser' object has no attribute 'readfp'
Product: [Fedora] Fedora Reporter: Tomáš Hrnčiar <thrnciar>
Component: python-iniparseAssignee: Igor Raits <igor.raits>
Status: CLOSED DEFERRED QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: hugovk+redhatbugzilla, igor.raits, jhnidek, lupinix.fedora, mhroncok, python-sig, thrnciar
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: 2022-02-07 12:02:29 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: 1992484, 2016048    

Description Tomáš Hrnčiar 2021-11-01 13:58:17 UTC
python-iniparse fails to build with Python 3.11.0a1.

======================================================================
ERROR: test_fuzz (tests.test_fuzz.test_fuzz)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/iniparse-0.4/tests/test_fuzz.py", line 101, in test_fuzz
    cc_py.readfp(StringIO(s))
    ^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'RawConfigParser' object has no attribute 'readfp'

======================================================================
ERROR: test_basic (tests.test_compat.RawConfigParserTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/iniparse-0.4/tests/test_compat.py", line 91, in test_basic
    self.failIf('__name__' in cf.options("Foo Bar"),
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'RawConfigParserTestCase' object has no attribute 'failIf'

======================================================================
ERROR: test_boolean (tests.test_compat.RawConfigParserTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/iniparse-0.4/tests/test_compat.py", line 217, in test_boolean
    self.failUnless(cf.getboolean('BOOLTEST', 't%d' % x))
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'RawConfigParserTestCase' object has no attribute 'failUnless'

======================================================================
ERROR: test_case_sensitivity (tests.test_compat.RawConfigParserTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/iniparse-0.4/tests/test_compat.py", line 122, in test_case_sensitivity
    self.failUnless(cf.has_option("a", "b"))
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'RawConfigParserTestCase' object has no attribute 'failUnless'

======================================================================
ERROR: test_query_errors (tests.test_compat.RawConfigParserTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/iniparse-0.4/tests/test_compat.py", line 178, in test_query_errors
    self.failIf(cf.has_section("Foo"),
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'RawConfigParserTestCase' object has no attribute 'failIf'

======================================================================
ERROR: test_basic (tests.test_compat.ConfigParserTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/iniparse-0.4/tests/test_compat.py", line 91, in test_basic
    self.failIf('__name__' in cf.options("Foo Bar"),
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'ConfigParserTestCase' object has no attribute 'failIf'

======================================================================
ERROR: test_boolean (tests.test_compat.ConfigParserTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/iniparse-0.4/tests/test_compat.py", line 217, in test_boolean
    self.failUnless(cf.getboolean('BOOLTEST', 't%d' % x))
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'ConfigParserTestCase' object has no attribute 'failUnless'

======================================================================
ERROR: test_case_sensitivity (tests.test_compat.ConfigParserTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/iniparse-0.4/tests/test_compat.py", line 122, in test_case_sensitivity
    self.failUnless(cf.has_option("a", "b"))
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'ConfigParserTestCase' object has no attribute 'failUnless'

======================================================================
ERROR: test_query_errors (tests.test_compat.ConfigParserTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/iniparse-0.4/tests/test_compat.py", line 178, in test_query_errors
    self.failIf(cf.has_section("Foo"),
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'ConfigParserTestCase' object has no attribute 'failIf'

======================================================================
ERROR: test_basic (tests.test_compat.SafeConfigParserTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/iniparse-0.4/tests/test_compat.py", line 91, in test_basic
    self.failIf('__name__' in cf.options("Foo Bar"),
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'SafeConfigParserTestCase' object has no attribute 'failIf'

======================================================================
ERROR: test_boolean (tests.test_compat.SafeConfigParserTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/iniparse-0.4/tests/test_compat.py", line 217, in test_boolean
    self.failUnless(cf.getboolean('BOOLTEST', 't%d' % x))
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'SafeConfigParserTestCase' object has no attribute 'failUnless'

======================================================================
ERROR: test_case_sensitivity (tests.test_compat.SafeConfigParserTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/iniparse-0.4/tests/test_compat.py", line 122, in test_case_sensitivity
    self.failUnless(cf.has_option("a", "b"))
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'SafeConfigParserTestCase' object has no attribute 'failUnless'

======================================================================
ERROR: test_query_errors (tests.test_compat.SafeConfigParserTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/iniparse-0.4/tests/test_compat.py", line 178, in test_query_errors
    self.failIf(cf.has_section("Foo"),
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'SafeConfigParserTestCase' object has no attribute 'failIf'

Removed from the configparser module: the SafeConfigParser class, the filename property of the ParsingError class, the readfp() method of the ConfigParser class, deprecated since Python 3.2. (Contributed by Hugo van Kemenade in bpo-45173.)

https://docs.python.org/3.11/whatsnew/3.11.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.11/fedora-rawhide-x86_64/02910121-python-iniparse/

For all our attempts to build python-iniparse with Python 3.11, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.11/package/python-iniparse/

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.11:
https://copr.fedorainfracloud.org/coprs/g/python/python3.11/

Let us know here if you have any questions.

Python 3.11 is already included in Fedora 35. To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.11.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon.
We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Tomáš Hrnčiar 2022-02-07 12:02:29 UTC
Changes in configparser module were reverted in Python 3.11 and will be part of Python 3.12, thus I am closing this bugzilla. On the other hand, I highly encourage you to work with the upstream to fix it so we won't have to deal with it next year.

Comment 2 Hugo van Kemenade 2022-05-10 14:34:27 UTC
Upstream issue: https://github.com/candlepin/python-iniparse/issues/23