Bug 2335830

Summary: python-lxml fails to build with Python 3.14: FileNotFoundError: [Errno 2] No such file or directory: 'file:/builddir/build/BUILD/python-lxml-5.3.0-build/lxml-5.3.0/src/lxml/tests/test_broken.xml'
Product: [Fedora] Fedora Reporter: Karolina Surma <ksurma>
Component: python-lxmlAssignee: Miro Hrončok <mhroncok>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: cstratak, igor.raits, lbalhar, me, mhroncok, mizdebsk, python-maint, python-packagers-sig
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-lxml-5.3.0-2.fc42 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-01-06 16:13:06 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: 2322407    

Description Karolina Surma 2025-01-06 15:04:24 UTC
python-lxml fails to build with Python 3.14.0a3 (since a1) because of a test failure.
Note we have a successful build without tests.

Upstream issues:
https://bugs.launchpad.net/lxml/+bug/2085619
https://github.com/python/cpython/issues/125974

Opening this here for tracking purposes.

+ /usr/bin/python3 test.py -vuf
<snip>
======================================================================
ERROR: test_xinclude_text (lxml.tests.test_etree.ElementIncludeTestCase.test_xinclude_text)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib64/python3.14/unittest/case.py", line 58, in testPartExecutor
    yield
  File "/usr/lib64/python3.14/unittest/case.py", line 660, in run
    self._callTestMethod(testMethod)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/usr/lib64/python3.14/unittest/case.py", line 606, in _callTestMethod
    result = method()
  File "/builddir/build/BUILD/python-lxml-5.3.0-build/lxml-5.3.0/src/lxml/tests/test_etree.py", line 4942, in test_xinclude_text
    self.include( etree.ElementTree(root) )
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/python-lxml-5.3.0-build/lxml-5.3.0/src/lxml/tests/test_etree.py", line 5043, in include
    self.ElementInclude.include(tree.getroot(), loader=loader, max_depth=max_depth)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/python-lxml-5.3.0-build/lxml-5.3.0/src/lxml/ElementInclude.py", line 173, in include
    _include(elem, loader, base_url, max_depth)
    ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/python-lxml-5.3.0-build/lxml-5.3.0/src/lxml/ElementInclude.py", line 217, in _include
    text = load_include(href, parse, encoding=e.get("encoding"))
  File "/builddir/build/BUILD/python-lxml-5.3.0-build/lxml-5.3.0/src/lxml/ElementInclude.py", line 120, in _lxml_default_loader
    f = open(href, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: 'file:/builddir/build/BUILD/python-lxml-5.3.0-build/lxml-5.3.0/src/lxml/tests/test_broken.xml'

----------------------------------------------------------------------
Ran 1962 tests in 6.989s

FAILED (errors=1)

For the build logs, see:
https://download.copr.fedorainfracloud.org/results/@python/python3.14/fedora-rawhide-x86_64/08474814-python-lxml/builder-live.log.gz

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

Comment 1 Miro Hrončok 2025-01-06 15:15:51 UTC
https://github.com/lxml/lxml/commit/9e95960cd69a3e0393f4266d60a6f5a2a755de0d fixes one of the failures reported upstream. The other one might no longer happen. Will check.

Comment 2 Miro Hrončok 2025-01-06 15:23:20 UTC
OK, the other failure seems gone. https://src.fedoraproject.org/rpms/python-lxml/pull-request/45

Comment 3 Miro Hrončok 2025-01-06 16:13:06 UTC
Fixed in distgit.