Title: minidom renameNode accepts invalid qualified names · Issue #162371 · python/cpython · GitHub
Open Graph Title: minidom renameNode accepts invalid qualified names · Issue #162371 · python/cpython
X Title: minidom renameNode accepts invalid qualified names · Issue #162371 · python/cpython
Description: Bug description: xml.dom.minidom.Document.renameNode() accepts invalid XML and qualified names that the other namespace-aware methods reject. A prefix with an empty namespace can produce XML with an unbound prefix. from xml.dom.minidom i...
Open Graph Description: Bug description: xml.dom.minidom.Document.renameNode() accepts invalid XML and qualified names that the other namespace-aware methods reject. A prefix with an empty namespace can produce XML with a...
X Description: Bug description: xml.dom.minidom.Document.renameNode() accepts invalid XML and qualified names that the other namespace-aware methods reject. A prefix with an empty namespace can produce XML with a...
Opengraph URL: https://github.com/python/cpython/issues/162371
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"minidom renameNode accepts invalid qualified names","articleBody":"### Bug description:\n\n`xml.dom.minidom.Document.renameNode()` accepts invalid XML and qualified names\nthat the other namespace-aware methods reject. A prefix with an empty namespace\ncan produce XML with an unbound prefix.\n\n```python\nfrom xml.dom.minidom import parseString\n\ndoc = parseString(\"\u003cdoc/>\")\ndoc.renameNode(doc.documentElement, None, \"p:e\")\nprint(doc.toxml())\n```\n\nCurrent output:\n\n```xml\n\u003c?xml version=\"1.0\" ?>\u003cp:e/>\n```\n\n`renameNode()` should raise `NamespaceErr`.\n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\nmacOS\n\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-162372\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/tonghuaroot","@type":"Person","name":"tonghuaroot"},"datePublished":"2026-11-21T09:33:33Z","url":"https://github.com/python/cpython/issues/162371"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:672f10c3-af40-c3bb-dbcd-5a1eb8fb7cd1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B980:1AE20C:38554DE:475BC29:6B01E937 |
| html-safe-nonce | 4d6434c31bafba0d64e9897a511c65c2ac6faeeb0204d4675bc08caa030a39ab |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOTgwOjFBRTIwQzozODU1NERFOjQ3NUJDMjk6NkIwMUU5MzciLCJ2aXNpdG9yX2lkIjoiNTc5OTE5OTYxNjYzMzI2ODUzNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | ca36056bc49f7583f9f7bd6ec3ff5a7483befe635c5d5d89dc3f7a37a1be3d54 |
| hovercard-subject-tag | issue:6527142679 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/162371/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9eb9e69235bfbe8a5a5d45192e7aa39786a51a9cd7dc6216106d22815a8c1106/python/cpython/issues/162371 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9eb9e69235bfbe8a5a5d45192e7aa39786a51a9cd7dc6216106d22815a8c1106/python/cpython/issues/162371 |
| og:image:alt | Bug description: xml.dom.minidom.Document.renameNode() accepts invalid XML and qualified names that the other namespace-aware methods reject. A prefix with an empty namespace can produce XML with a... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tonghuaroot |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width