GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — `xml.dom` documents wrong exceptions for some methods · Issue #156635 · python/cpython

xml.dom documents wrong exceptions for some methods #156635

New issue
Copy link
New issue
Copy link
Closed
Closed
xml.dom documents wrong exceptions for some methods#156635
Copy link
Labels
3.13only security fixesonly security fixes3.14bugs and security fixesbugs and security fixes3.15bugs and security fixesbugs and security fixes3.16new features, bugs and security fixesnew features, bugs and security fixesdocsDocumentation in the Doc dirDocumentation in the Doc dirtopic-XML

Description

@serhiy-storchaka
serhiy-storchaka
opened on Aug 30, 2026
Issue body actions

Node.insertBefore(), Node.removeChild() and Node.replaceChild() are documented as raising ValueError if the node is not a child of this node, but they raise NotFoundErr, which is not a ValueError.

>>> import xml.dom.minidom
>>> doc = xml.dom.minidom.parseString('<r><c/></r>')
>>> doc.documentElement.removeChild(doc.createElement('x'))
xml.dom.NotFoundErr

Element.removeAttribute() is documented as raising NotFoundErr if there is no matching attribute, and Element.removeAttributeNS() is documented as raising nothing. Both raise NotFoundErr, so the two descriptions contradict each other. The DOM specifies that removing an absent attribute has no effect, so this is a deviation of xml.dom.minidom and should be documented in its documentation.

Affects all maintained versions.

Linked PRs

  • gh-156635: Fix the exceptions in the xml.dom documentation #156636
  • [3.15] gh-156635: Fix the exceptions in the xml.dom documentation (GH-156636) #156637
  • [3.14] gh-156635: Fix the exceptions in the xml.dom documentation (GH-156636) #156638
  • [3.13] gh-156635: Fix the exceptions in the xml.dom documentation (GH-156636) #156639

Activity

  1. serhiy-storchaka
    added
    docsDocumentation in the Doc dirDocumentation in the Doc dir
    on Aug 30, 2026
  2. github-project-automation
    added this to docs issueson Aug 30, 2026
  3. serhiy-storchaka
    added
    topic-XML
    on Aug 30, 2026
  4. github-project-automation
    moved this to Todo in docs issueson Aug 30, 2026
  5. serhiy-storchaka
    added
    3.13only security fixesonly security fixes
    3.14bugs and security fixesbugs and security fixes
    3.15bugs and security fixesbugs and security fixes
    3.16new features, bugs and security fixesnew features, bugs and security fixes
    on Aug 30, 2026
  6. serhiy-storchaka
    added 2 commits that reference this issue on Aug 30, 2026

    gh-156635: Fix the exceptions in the xml.dom documentation (GH-156636)

    74b944a

    [3.14] gh-156635: Fix the exceptions in the xml.dom documentation (GH…

    0ee064f
  7. serhiy-storchaka
    closed this as completedon Aug 30, 2026
  8. serhiy-storchaka
    added a commit that references this issue on Aug 30, 2026

    [3.13] gh-156635: Fix the exceptions in the xml.dom documentation (GH…

    9148b70
  9. hugovk
    added a commit that references this issue on Aug 31, 2026

    [3.15] gh-156635: Fix the exceptions in the xml.dom documentation (GH…

    00347e2
  10. clin1234
    added a commit that references this issue on Sep 12, 2026

    pythongh-156635: Fix the exceptions in the xml.dom documentation (pyt…

    6e0aba1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.13only security fixesonly security fixes3.14bugs and security fixesbugs and security fixes3.15bugs and security fixesbugs and security fixes3.16new features, bugs and security fixesnew features, bugs and security fixesdocsDocumentation in the Doc dirDocumentation in the Doc dirtopic-XML

    Projects

    • docs issues
      Status
      Todo
      Show more project fields

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402520 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.