Bug 2176142

Summary: python-iniparse fails to build with Python 3.12: AttributeError: 'RawConfigParser' object has no attribute 'readfp'.
Product: [Fedora] Fedora Reporter: Tomáš Hrnčiar <thrnciar>
Component: python-iniparseAssignee: Ali Erdinc Koroglu <aekoroglu>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: aekoroglu, igor.raits, jhnidek, lupinix.fedora, mhroncok, petersen, python-packagers-sig, thrnciar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-iniparse-0.5-5.fc39 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-07-07 05:00:54 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: 2135404, 2220278    

Description Tomáš Hrnčiar 2023-03-07 13:55:57 UTC
python-iniparse fails to build with Python 3.12.0a5.

======================================================================
ERROR: test_fuzz (tests.test_fuzz.TestFuzz.test_fuzz)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/python-iniparse-0.5/tests/test_fuzz.py", line 105, in test_fuzz
    cc_py.readfp(StringIO(s))
    ^^^^^^^^^^^^
AttributeError: 'RawConfigParser' object has no attribute 'readfp'. Did you mean: 'read'?

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

======================================================================
ERROR: test_boolean (tests.test_compat.RawConfigParserTestCase.test_boolean)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/python-iniparse-0.5/tests/test_compat.py", line 224, 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.test_case_sensitivity)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/python-iniparse-0.5/tests/test_compat.py", line 130, 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.test_query_errors)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/python-iniparse-0.5/tests/test_compat.py", line 185, in test_query_errors
    self.failIf(cf.has_section("Foo"),
    ^^^^^^^^^^^
AttributeError: 'RawConfigParserTestCase' object has no attribute 'failIf'. Did you mean: 'fail'?

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

======================================================================
ERROR: test_boolean (tests.test_compat.ConfigParserTestCase.test_boolean)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/python-iniparse-0.5/tests/test_compat.py", line 224, 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.test_case_sensitivity)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/python-iniparse-0.5/tests/test_compat.py", line 130, 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.test_query_errors)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/python-iniparse-0.5/tests/test_compat.py", line 185, in test_query_errors
    self.failIf(cf.has_section("Foo"),
    ^^^^^^^^^^^
AttributeError: 'ConfigParserTestCase' object has no attribute 'failIf'. Did you mean: 'fail'?

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

======================================================================
ERROR: test_boolean (tests.test_compat.SafeConfigParserTestCase.test_boolean)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/python-iniparse-0.5/tests/test_compat.py", line 224, 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.test_case_sensitivity)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/python-iniparse-0.5/tests/test_compat.py", line 130, 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.test_query_errors)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/python-iniparse-0.5/tests/test_compat.py", line 185, in test_query_errors
    self.failIf(cf.has_section("Foo"),
    ^^^^^^^^^^^
AttributeError: 'SafeConfigParserTestCase' object has no attribute 'failIf'. Did you mean: 'fail'?

Removed many old deprecated unittest features:
    - A number of TestCase method aliases:

    | Deprecated alias      |  Method Name           | Deprecated in |
    +-----------------------|------------------------|---------------+
    | failUnless            | assertTrue()           |      3.1      |
    | failIf                | assertFalse()          |      3.1      |
    | failUnlessEqual       | assertEqual()          |      3.1      |
    | failIfEqual           | assertNotEqual()       |      3.1      |
    | failUnlessAlmostEqual | assertAlmostEqual()    |      3.1      |
    | failIfAlmostEqual     | assertNotAlmostEqual() |      3.1      |
    | failUnlessRaises      | assertRaises()         |      3.1      |
    | assert_               | assertTrue()           |      3.2      |
    | assertEquals          | assertEqual()          |      3.2      |
    | assertNotEquals       | assertNotEqual()       |      3.2      |
    | assertAlmostEquals    | assertAlmostEqual()    |      3.2      |
    | assertNotAlmostEquals | assertNotAlmostEqual() |      3.2      |
    | assertRegexpMatches   | assertRegex()          |      3.2      |
    | assertRaisesRegexp    | assertRaisesRegex()    |      3.2      |
    | assertNotRegexpMatches| assertNotRegex()       |      3.5      |
    +-----------------------|------------------------|---------------+

    You can use https://github.com/isidentical/teyit to automatically modernise your unit tests.

    - Undocumented and broken TestCase method assertDictContainsSubset (deprecated in Python 3.2).

    - Undocumented TestLoader.loadTestsFromModule parameter use_load_tests (deprecated and ignored since Python 3.2).

    - An alias of the TextTestResult class: _TextTestResult (deprecated in Python
3.2).

(Contributed by Serhiy Storchaka in bpo-45162.)
https://bugs.python.org/issue?@action=redirect&bpo=45162
https://docs.python.org/3.12/whatsnew/3.12.html

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

For all our attempts to build python-iniparse with Python 3.12, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.12/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.12:
https://copr.fedorainfracloud.org/coprs/g/python/python3.12/

Let us know here if you have any questions.

Python 3.12 is planned to be included in Fedora 39. To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.12.
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 Fedora Update System 2023-07-07 04:58:05 UTC
FEDORA-2023-612c573704 has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2023-612c573704

Comment 2 Fedora Update System 2023-07-07 05:00:54 UTC
FEDORA-2023-612c573704 has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.