Bug 2264859

Summary: python-lxml FTBFS: test_simple_xml : AssertionError: Lists differ: [] != [('end', 'element')]
Product: [Fedora] Fedora Reporter: Karolina Surma <ksurma>
Component: python-lxmlAssignee: Miro Hrončok <mhroncok>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: cstratak, igor.raits, ksurma, lbalhar, me, mhroncok, mizdebsk, python-maint, python-packagers-sig
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-lxml-5.1.0-6.fc41 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-03-04 11:23:16 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: 2231791, 2260875, 2244836    

Description Karolina Surma 2024-02-19 10:31:02 UTC
python-lxml fails to build with Python 3.13.0a4.

======================================================================
FAIL: test_simple_xml (lxml.tests.test_elementtree.ElementTreePullTestCase.test_simple_xml)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib64/python3.13/unittest/case.py", line 58, in testPartExecutor
    yield
  File "/usr/lib64/python3.13/unittest/case.py", line 634, in run
    self._callTestMethod(testMethod)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/usr/lib64/python3.13/unittest/case.py", line 589, in _callTestMethod
    if method() is not None:
       ~~~~~~^^
  File "/builddir/build/BUILD/lxml-5.1.0/src/lxml/tests/test_elementtree.py", line 4398, in test_simple_xml
    self.assert_event_tags(parser, [('end', 'element')])
    ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/lxml-5.1.0/src/lxml/tests/test_elementtree.py", line 4383, in assert_event_tags
    self.assertEqual([(action, elem.tag) for action, elem in events],
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                     expected)
                     ^^^^^^^^^
  File "/usr/lib64/python3.13/unittest/case.py", line 885, in assertEqual
    assertion_func(first, second, msg=msg)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.13/unittest/case.py", line 1091, in assertListEqual
    self.assertSequenceEqual(list1, list2, msg, seq_type=list)
    ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.13/unittest/case.py", line 1073, in assertSequenceEqual
    self.fail(msg)
    ~~~~~~~~~^^^^^
  File "/usr/lib64/python3.13/unittest/case.py", line 715, in fail
    raise self.failureException(msg)
AssertionError: Lists differ: [] != [('end', 'element')]

Second list contains 1 additional elements.
First extra element 0:
('end', 'element')

- []
+ [('end', 'element')]

----------------------------------------------------------------------
Ran 1961 tests in 3.907s

FAILED (failures=1)

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

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.13/fedora-rawhide-x86_64/07033831-python-lxml/

For all our attempts to build python-lxml with Python 3.13, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/package/python-lxml/

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

Let us know here if you have any questions.

Python 3.13 is planned to be included in Fedora 41.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.13.
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 Karolina Surma 2024-02-19 10:33:56 UTC
FTR, this is not Python 3.13-specific, see: https://koschei.fedoraproject.org/package/python-lxml

Comment 2 Miro Hrončok 2024-02-21 10:30:26 UTC
Same failure on Fedora 40.

Also, python3.12 fails for similar reasons: https://koschei.fedoraproject.org/package/python3.12

Comment 3 Miro Hrončok 2024-02-21 10:47:21 UTC
Suspicious upgrade from Koschei:

 expat
2.5.0-5.fc40
2.6.0-1.fc41

Possible fix for Python:

https://github.com/python/cpython/issues/115133 https://github.com/python/cpython/pull/115288

Comment 4 Miro Hrončok 2024-02-21 11:01:32 UTC
Python: https://src.fedoraproject.org/rpms/python3.12/pull-request/106

Comment 5 Miro Hrončok 2024-02-27 17:47:52 UTC
lxml: https://github.com/lxml/lxml/pull/407

Comment 6 Miro Hrončok 2024-03-04 08:27:03 UTC
Fedora PR: https://src.fedoraproject.org/rpms/python-lxml/pull-request/40

Comment 7 Fedora Update System 2024-03-04 09:51:32 UTC
FEDORA-2024-5535e2a331 (python-lxml-5.1.0-6.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-5535e2a331

Comment 8 Fedora Update System 2024-03-04 11:23:16 UTC
FEDORA-2024-5535e2a331 (python-lxml-5.1.0-6.fc41) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.