Bug 2019017 - python-iniparse fails to build with Python 3.11: AttributeError: 'RawConfigParser' object has no attribute 'readfp'
Summary: python-iniparse fails to build with Python 3.11: AttributeError: 'RawConfigP...
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: Fedora
Classification: Fedora
Component: python-iniparse
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Igor Raits
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: F36FTBFS PYTHON3.11
TreeView+ depends on / blocked
 
Reported: 2021-11-01 13:58 UTC by Tomáš Hrnčiar
Modified: 2022-05-11 15:26 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-02-07 12:02:29 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github candlepin python-iniparse issues 23 0 None open Replace deprecated ConfigParser readfp and unittest aliases for Python 3.12 2022-05-11 15:26:04 UTC
Github candlepin python-iniparse pull 24 0 None open Fix compatibility issues with Python 3.11 2022-05-11 15:26:04 UTC

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


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