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 — Incorrect and missing statements in the xml.parsers.expat documentation · Issue #156821 · python/cpython

Incorrect and missing statements in the xml.parsers.expat documentation #156821

New issue
Copy link
New issue
Copy link
Closed
Closed
Incorrect and missing statements in the xml.parsers.expat documentation#156821
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 Sep 2, 2026
Issue body actions

Several statements in the documentation of xml.parsers.expat do not match the behaviour, and a part of the API is not documented at all. Some docstrings have the same problems.

Incorrect:

  • GetInputContext() is described as returning a string, but it returns bytes. Its result also extends to the end of the currently buffered input, so it can contain the data of the following events.
  • Parse() is described as parsing "the string data", but data can be a bytes-like object as well as a string, and if it is a string, the encoding declaration is ignored.
  • ParseFile() is described as reading from a file whose read() returns "the empty string when there's no more data", but only binary files are supported (expat ParseFile expects bytes, not string #60930).
  • XML_ERROR_XML_DECL is described as "The document contained no document element at all". It means "XML declaration not well-formed"; the given description belongs to XML_ERROR_NO_ELEMENTS.
  • UnparsedEntityDeclHandler is described as "only present for version 1.2 of the Expat library", but it is present and called with Expat 2.8.4.
  • The docstring of GetSpecifiedAttributeCount() omits that the result is only meaningful if ordered_attributes is true.

Not documented:

  • the intern parameter of ParserCreate() and the intern attribute, which xml.sax uses for the string interning feature;
  • the namespace_prefixes attribute;
  • the SkippedEntityHandler handler;
  • XML_CTYPE_MIXED and XML_CTYPE_NAME, whose descriptions are empty;
  • EXPAT_VERSION, version_info and features, although the XML security documentation already refers to EXPAT_VERSION.

Also, the notes about Expat versions 1.2 and 1.95.0 are obsolete, the list of attribute types in AttlistDeclHandler ends with "...", and all content model constants are marked with :noindex: although they have no other description, so they cannot be referenced.

Linked PRs

  • gh-156821: Fix inaccuracies in the xml.parsers.expat documentation #156822
  • [3.15] gh-156821: Fix inaccuracies in the xml.parsers.expat documentation (GH-156822) #156852
  • [3.14] gh-156821: Fix inaccuracies in the xml.parsers.expat documentation (GH-156822) #156853
  • [3.13] gh-156821: Fix inaccuracies in the xml.parsers.expat documentation (GH-156822) #156854

Activity

  1. serhiy-storchaka
    added
    docsDocumentation in the Doc dirDocumentation in the Doc dir
    topic-XML
    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 Sep 2, 2026
  2. github-project-automation
    added this to docs issueson Sep 2, 2026
  3. github-project-automation
    moved this to Todo in docs issueson Sep 2, 2026
  4. serhiy-storchaka
    marked Incorrect and missing statements in the xml.parsers.expat documentation #156820 as a duplicate of this issue on Sep 2, 2026
  5. serhiy-storchaka
    added 4 commits that reference this issue on Sep 2, 2026

    gh-156821: Fix inaccuracies in the xml.parsers.expat documentation (G…

    d16a691

    [3.14] pythongh-156821: Fix inaccuracies in the xml.parsers.expat doc…

    143a01c

    [3.13] gh-156821: Fix inaccuracies in the xml.parsers.expat documenta…

    3c36e4a

    [3.14] gh-156821: Fix inaccuracies in the xml.parsers.expat documenta…

    3b57bf8
  6. serhiy-storchaka
    closed this as completedon Sep 2, 2026
  7. clin1234
    added a commit that references this issue on Sep 12, 2026

    pythongh-156821: Fix inaccuracies in the xml.parsers.expat documentat…

    ba7bece
  8. serhiy-storchaka
    added a commit that references this issue on Oct 9, 2026

    [3.15] gh-156821: Fix inaccuracies in the xml.parsers.expat documenta…

    768b6ee
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.