Package: src:python-et-xmlfile
Version: 2.0.0-2
User: [email protected]
Usertags: python3.15
Tags: ftbfs, forky, sid
Severity: important

Hi!

While rebuilding the python related packages against the Python 3.15rc2 version we found that python-et-xmlfile fails to build from source:
https://debusine.debian.net/debian/r-python-python3.15/artifact/4855957/

In the log, there are several errors related to new warnings or error messages that don't match the expectation: =================================== FAILURES =================================== ________________________ ElementTreeTest.test_iterparse ________________________

self = <et_xmlfile.tests.test_incremental_tree_with_stdlib_tests.make_modified_tests.<locals>.ElementTreeTest testMethod=test_iterparse>

    def test_iterparse(self):
        if sys.version_info[:2] < (3, 9):
            pass
        elif sys.version_info[:2] < (3, 13):
            self._test_iterparse_pre_3_13()
        else:
          super().test_iterparse()

__class__ = <class 'et_xmlfile.tests.stdlib_base_tests.ElementTreeTest'> self = <et_xmlfile.tests.test_incremental_tree_with_stdlib_tests.make_modified_tests.<locals>.ElementTreeTest testMethod=test_iterparse>

et_xmlfile/tests/stdlib_base_tests.py:285:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
et_xmlfile/tests/_vendor/test/test_xml_etree.py:697: in test_iterparse
    with warnings_helper.check_no_resource_warning(self):
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        action     = 'end'
context = <xml.etree.ElementTree.iterparse.<locals>.IterParseIterator object at 0x7fdba566cad0>
        elem       = <Element 'document' at 0x7fdba4da3510>
        events     = ('start-ns',)
        f          = <_io.BufferedWriter name='@test_105_tmpæ'>
        iterparse  = <function iterparse at 0x7fdba625c1a0>
        res        = ['start-ns', 'end-ns']
self = <et_xmlfile.tests.test_incremental_tree_with_stdlib_tests.make_modified_tests.<locals>.ElementTreeTest testMethod=test_iterparse>
        source     = <_io.StringIO object at 0x7fdba4cb68c0>
/usr/lib/python3.15/contextlib.py:210: in __exit__
    next(self.gen)
self = <contextlib._GeneratorContextManager object at 0x7fdba54f6660>
        traceback  = None
        typ        = None
        value      = None
et_xmlfile/tests/_vendor/test/support/warnings_helper.py:148: in check_no_resource_warning with check_no_warnings(testcase, category=ResourceWarning, force_gc=True): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ testcase = <et_xmlfile.tests.test_incremental_tree_with_stdlib_tests.make_modified_tests.<locals>.ElementTreeTest testMethod=test_iterparse>
/usr/lib/python3.15/contextlib.py:210: in __exit__
    next(self.gen)
self = <contextlib._GeneratorContextManager object at 0x7fdba54f7000>
        traceback  = None
        typ        = None
        value      = None
et_xmlfile/tests/_vendor/test/support/warnings_helper.py:131: in check_no_warnings
    testcase.assertEqual(warns, [])
E AssertionError: Lists differ: [<WarningMessage {message : ResourceWarnin[312 chars]ne}>] != []
E
E   First list contains 1 additional elements.
E   First extra element 0:
E <WarningMessage {message : ResourceWarning("unclosed iterparse iterator '@test_105_tmpæ'"), category : 'ResourceWarning', module : 'et_xmlfile.tests._vendor.test.test_xml_etree', filename : '/build/reproducible-path/python-et-xmlfile-2.0.0/.pybuild/cpython3_3.15_et-xmlfile/build/et_xmlfile/tests/_vendor/test/test_xml_etree.py', lineno : 702, line : None}>
E
E - [<WarningMessage {message : ResourceWarning("unclosed iterparse iterator '@test_105_tmpæ'"), category : 'ResourceWarning', module : 'et_xmlfile.tests._vendor.test.test_xml_etree', filename : '/build/reproducible-path/python-et-xmlfile-2.0.0/.pybuild/cpython3_3.15_et-xmlfile/build/et_xmlfile/tests/_vendor/test/test_xml_etree.py', lineno : 702, line : None}>]
E   + []
        category   = <class 'ResourceWarning'>
        force_gc   = True
        gc_collect = <function gc_collect at 0x7fdba53c8670>
        message    = ''
testcase = <et_xmlfile.tests.test_incremental_tree_with_stdlib_tests.make_modified_tests.<locals>.ElementTreeTest testMethod=test_iterparse> warns = [<WarningMessage {message : ResourceWarning("unclosed iterparse iterator '@test_105_tmpæ'"), category : 'ResourceWarni.../.pybuild/cpython3_3.15_et-xmlfile/build/et_xmlfile/tests/_vendor/test/test_xml_etree.py', lineno : 702, line : None}>] ________________________ ElementTreeTest.test_simpleops ________________________ ValueError: <Element 'subtag' at 0x7fdba4935b70> not in <Element 'tag' at 0x7fdba4935120>

During handling of the above exception, another exception occurred:

self = <et_xmlfile.tests.test_incremental_tree_with_stdlib_tests.make_modified_tests.<locals>.ElementTreeTest testMethod=test_simpleops>

    @unittest.skipIf(
        (
            platform.python_implementation() == "PyPy"
            and sys.version_info[:3] < (3, 12)
        ),
        "Functionality reverted but not picked up by PyPy yet",
    )
    def test_simpleops(self):
        if sys.version_info[:2] < (3, 14):
            self._test_simpleops_pre_3_13()
        else:
          super().test_simpleops()

__class__ = <class 'et_xmlfile.tests.stdlib_base_tests.ElementTreeTest'> self = <et_xmlfile.tests.test_incremental_tree_with_stdlib_tests.make_modified_tests.<locals>.ElementTreeTest testMethod=test_simpleops>

et_xmlfile/tests/stdlib_base_tests.py:147:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
et_xmlfile/tests/_vendor/test/test_xml_etree.py:375: in test_simpleops
    with self.assertRaisesRegex(ValueError,
E AssertionError: "Element\.remove\(.+\): element not found" does not match "<Element 'subtag' at 0x7fdba4935b70> not in <Element 'tag' at 0x7fdba4935120>"
        e          = <Element 'tag2' at 0x7fdba4936570>
        elem       = <Element 'body' at 0x7fdba4935620>
        element    = <Element 'tag' at 0x7fdba4935120>
self = <et_xmlfile.tests.test_incremental_tree_with_stdlib_tests.make_modified_tests.<locals>.ElementTreeTest testMethod=test_simpleops>
        subelement = <Element 'subtag' at 0x7fdba4935b70>
_______________________ KeywordArgsTest.test_issue14818 ________________________
TypeError: Element() argument 2 must be dict or frozendict, not str

During handling of the above exception, another exception occurred:

self = <et_xmlfile.tests.test_incremental_tree_with_stdlib_tests.KeywordArgsTest testMethod=test_issue14818>

    def test_issue14818(self):
        x = ET.XML("<a>foo</a>")
        self.assertEqual(x.find('a', None),
                         x.find(path='a', namespaces=None))
        self.assertEqual(x.findtext('a', None, None),
x.findtext(path='a', default=None, namespaces=None))
        self.assertEqual(x.findall('a', None),
                         x.findall(path='a', namespaces=None))
        self.assertEqual(list(x.iterfind('a', None)),
                         list(x.iterfind(path='a', namespaces=None)))

        self.assertEqual(ET.Element('a').attrib, {})
        elements = [
            ET.Element('a', dict(href="#", id="foo")),
            ET.Element('a', attrib=dict(href="#", id="foo")),
            ET.Element('a', dict(href="#"), id="foo"),
            ET.Element('a', href="#", id="foo"),
ET.Element('a', dict(href="#", id="foo"), href="#", id="foo"),
        ]
        for e in elements:
            self.assertEqual(e.tag, 'a')
            self.assertEqual(e.attrib, dict(href="#", id="foo"))

e2 = ET.SubElement(elements[0], 'foobar', attrib={'key1': 'value1'})
        self.assertEqual(e2.attrib['key1'], 'value1')

      with self.assertRaisesRegex(TypeError, 'must be dict, not str'):
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E AssertionError: "must be dict, not str" does not match "Element() argument 2 must be dict or frozendict, not str"

e          = <Element 'a' at 0x7fdba4e60540>
e2         = <Element 'foobar' at 0x7fdba4e60450>
elements = [<Element 'a' at 0x7fdba4e60130>, <Element 'a' at 0x7fdba4e60630>, <Element 'a' at 0x7fdba4e605e0>, <Element 'a' at 0x7fdba4e60270>, <Element 'a' at 0x7fdba4e60540>] self = <et_xmlfile.tests.test_incremental_tree_with_stdlib_tests.KeywordArgsTest testMethod=test_issue14818>
x          = <Element 'a' at 0x7fdba4e60680>

et_xmlfile/tests/_vendor/test/test_xml_etree.py:4360: AssertionError

Setting the severity to important for now. Once Python 3.15 is released and later added to python3-defaults, this bug will become release critical.

--
Regards,
Marga

Reply via email to