Thanks to visit codestin.com
Credit goes to github.com

Skip to content

gh-156665: Validate namespaces in xml.dom.minidom - #156666

Merged
serhiy-storchaka merged 2 commits into
python:mainfrom
serhiy-storchaka:gh-156665-namespace-validation
Sep 13, 2026
Merged

gh-156665: Validate namespaces in xml.dom.minidom#156666
serhiy-storchaka merged 2 commits into
python:mainfrom
serhiy-storchaka:gh-156665-namespace-validation

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Aug 30, 2026

Copy link
Copy Markdown
Member

NamespaceErr is now raised by createElementNS(), createAttributeNS(), setAttributeNS() and when setting the prefix of an attribute.

Two existing tests created xmlns:python attributes with "http://www.w3.org" as the namespace URI instead of the XMLNS namespace, and are fixed here.

createElementNS(), createAttributeNS() and setAttributeNS() now raise
NamespaceErr for a malformed qualified name, for a prefix with an empty
namespace, and for illegal use of the "xml" and "xmlns" prefixes, as required
by DOM Level 2 Core.  Setting the prefix of an attribute is validated too.

Two tests used a wrong namespace URI for xmlns attributes.
@read-the-docs-community

read-the-docs-community Bot commented Aug 30, 2026

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #34535512 | 📁 Comparing 19e0f0e against main (26d9b25)

  🔍 Preview build  

60 files changed · + 1 added · ± 58 modified · - 1 deleted

+ Added

± Modified

- Deleted

@serhiy-storchaka
serhiy-storchaka merged commit ad447fa into python:main Sep 13, 2026
54 checks passed
@serhiy-storchaka
serhiy-storchaka deleted the gh-156665-namespace-validation branch September 13, 2026 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant