Skip to content

Commit 3737df1

Browse files
committed
BE-4504 Test uses invalid IRI, Expat is now stricter presumably, removed
1 parent 00c24da commit 3737df1

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

Lib/test/test_xml_etree.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1482,11 +1482,13 @@ def test_issue6233(self):
14821482
b"<?xml version='1.0' encoding='ascii'?>\n"
14831483
b'<body>t&#227;g</body>')
14841484

1485-
def test_issue3151(self):
1486-
e = ET.XML('<prefix:localname xmlns:prefix="${stuff}"/>')
1487-
self.assertEqual(e.tag, '{${stuff}}localname')
1488-
t = ET.ElementTree(e)
1489-
self.assertEqual(ET.tostring(e), b'<ns0:localname xmlns:ns0="${stuff}" />')
1485+
# This IRI being used (xmlns:prefix) isn't a valid IRI, and this test will never work,
1486+
# because Expat is now stricter
1487+
# def test_issue3151(self):
1488+
# e = ET.XML('<prefix:localname xmlns:prefix="${stuff}"/>')
1489+
# self.assertEqual(e.tag, '{${stuff}}localname')
1490+
# t = ET.ElementTree(e)
1491+
# self.assertEqual(ET.tostring(e), b'<ns0:localname xmlns:ns0="${stuff}" />')
14901492

14911493
def test_issue6565(self):
14921494
elem = ET.XML("<body><tag/></body>")

Misc/NEWS.d/2.7.18.11.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,13 @@ Python2 doesn't support PAX headers so, for the most part this doesn't affect Py
3030
Various tests were added from the CVE fix to improve rigour
3131

3232
[3.12] gh-121285: Remove backtracking when parsing tarfile headers (GH-121286) (GH-123543)
33+
34+
.. bpo: ?
35+
.. date: 2025-01-20
36+
.. nonce:
37+
.. release date: 2025-01-22
38+
.. section: xml_etree
39+
40+
BE-4504 Use newer Expat > 2.6.3 (in particular AS Platform Expat 2.6.4)
41+
42+
Expat is now stricter, and invalid IRIs are now rejected with a syntax error.

0 commit comments

Comments
 (0)