mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
bpo-46811: Make test suite support Expat >=2.4.5 (GH-31453)
Curly brackets were never allowed in namespace URIs according to RFC 3986, and so-called namespace-validating XML parsers have the right to reject them a invalid URIs. libexpat >=2.4.5 has become strcter in that regard due to related security issues; with ET.XML instantiating a namespace-aware parser under the hood, this test has no future in CPython. References: - https://datatracker.ietf.org/doc/html/rfc3968 - https://www.w3.org/TR/xml-names/ Also, test_minidom.py: Support Expat >=2.4.5
This commit is contained in:
parent
2b86616456
commit
2cae93832f
3 changed files with 16 additions and 8 deletions
|
@ -2192,12 +2192,6 @@ class BugsTest(unittest.TestCase):
|
|||
b"<?xml version='1.0' encoding='ascii'?>\n"
|
||||
b'<body>tãg</body>')
|
||||
|
||||
def test_issue3151(self):
|
||||
e = ET.XML('<prefix:localname xmlns:prefix="${stuff}"/>')
|
||||
self.assertEqual(e.tag, '{${stuff}}localname')
|
||||
t = ET.ElementTree(e)
|
||||
self.assertEqual(ET.tostring(e), b'<ns0:localname xmlns:ns0="${stuff}" />')
|
||||
|
||||
def test_issue6565(self):
|
||||
elem = ET.XML("<body><tag/></body>")
|
||||
self.assertEqual(summarize_list(elem), ['tag'])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue