Closed
Closed
Copy link
Description
Bug report
Bug description:
Expat 2.6.0 was released yesterday, with CVE fixes. After upgrading the system library and building CPython --with-system-expat
, I'm getting the following test failures:
======================================================================
FAIL: test_simple_xml (test.test_xml_etree.XMLPullParserTest.test_simple_xml) (chunk_size=1)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/mgorny/git/cpython/Lib/test/test_xml_etree.py", line 1495, in test_simple_xml
self.assert_event_tags(parser, [('end', 'element')])
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/mgorny/git/cpython/Lib/test/test_xml_etree.py", line 1480, in assert_event_tags
self.assertEqual([(action, elem.tag) for action, elem in events],
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
expected)
^^^^^^^^^
AssertionError: Lists differ: [] != [('end', 'element')]
Second list contains 1 additional elements.
First extra element 0:
('end', 'element')
- []
+ [('end', 'element')]
======================================================================
FAIL: test_simple_xml (test.test_xml_etree.XMLPullParserTest.test_simple_xml) (chunk_size=5)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/mgorny/git/cpython/Lib/test/test_xml_etree.py", line 1498, in test_simple_xml
self.assert_event_tags(parser, [
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
('end', 'element'),
^^^^^^^^^^^^^^^^^^^
('end', 'empty-element'),
^^^^^^^^^^^^^^^^^^^^^^^^^
])
^^
File "/home/mgorny/git/cpython/Lib/test/test_xml_etree.py", line 1480, in assert_event_tags
self.assertEqual([(action, elem.tag) for action, elem in events],
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
expected)
^^^^^^^^^
AssertionError: Lists differ: [('end', 'element')] != [('end', 'element'), ('end', 'empty-element')]
Second list contains 1 additional elements.
First extra element 1:
('end', 'empty-element')
- [('end', 'element')]
+ [('end', 'element'), ('end', 'empty-element')]
----------------------------------------------------------------------
======================================================================
FAIL: test_simple_xml (test.test_xml_etree_c.XMLPullParserTest.test_simple_xml) (chunk_size=1)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/mgorny/git/cpython/Lib/test/test_xml_etree.py", line 1495, in test_simple_xml
self.assert_event_tags(parser, [('end', 'element')])
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/mgorny/git/cpython/Lib/test/test_xml_etree.py", line 1480, in assert_event_tags
self.assertEqual([(action, elem.tag) for action, elem in events],
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
expected)
^^^^^^^^^
AssertionError: Lists differ: [] != [('end', 'element')]
Second list contains 1 additional elements.
First extra element 0:
('end', 'element')
- []
+ [('end', 'element')]
======================================================================
FAIL: test_simple_xml (test.test_xml_etree_c.XMLPullParserTest.test_simple_xml) (chunk_size=5)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/mgorny/git/cpython/Lib/test/test_xml_etree.py", line 1498, in test_simple_xml
self.assert_event_tags(parser, [
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
('end', 'element'),
^^^^^^^^^^^^^^^^^^^
('end', 'empty-element'),
^^^^^^^^^^^^^^^^^^^^^^^^^
])
^^
File "/home/mgorny/git/cpython/Lib/test/test_xml_etree.py", line 1480, in assert_event_tags
self.assertEqual([(action, elem.tag) for action, elem in events],
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
expected)
^^^^^^^^^
AssertionError: Lists differ: [('end', 'element')] != [('end', 'element'), ('end', 'empty-element')]
Second list contains 1 additional elements.
First extra element 1:
('end', 'empty-element')
- [('end', 'element')]
+ [('end', 'element'), ('end', 'empty-element')]
----------------------------------------------------------------------
I have reproduced with 3.11.8, 3.12.8 and main as of 2afc718, both using Gentoo ebuild and raw git repository. I've tested the latter like this:
./configure -C --with-system-expat
make -j12
./python -u -W default -bb -E -m test -vv test_xml_etree{,_c}
CC @hartwork
CPython versions tested on:
3.11, 3.12, CPython main branch
Operating systems tested on:
Linux
Linked PRs
- gh-115133: test_xml_etree.py: Fix for Expat >=2.6.0 with reparse deferral (fixes #115133) #115138
- gh-115133: Fix tests for XMLPullParser with Expat 2.6.0 #115164
- [3.12] gh-115133: Fix tests for XMLPullParser with Expat 2.6.0 (GH-115164) #115288
- [3.11] gh-115133: Fix tests for XMLPullParser with Expat 2.6.0 (GH-115164) #115289
- [3.10] gh-115133: Fix tests for XMLPullParser with Expat 2.6.0 (GH-115164) #115525
- [3.9] Fix tests for XMLPullParser with Expat 2.6.0 (GH-115133) #115535
- [3.8] gh-115133: Fix tests for XMLPullParser with Expat 2.6.0 (GH-115164 #115536