Repository navigation
Incorrect and missing statements in the xml.parsers.expat documentation #156821
Copy link
Copy link
Closed
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
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 whoseread()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_DECLis described as "The document contained no document element at all". It means "XML declaration not well-formed"; the given description belongs toXML_ERROR_NO_ELEMENTS.UnparsedEntityDeclHandleris 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 ifordered_attributesis true.
Not documented:
- the intern parameter of
ParserCreate()and theinternattribute, whichxml.saxuses for the string interning feature; - the
namespace_prefixesattribute; - the
SkippedEntityHandlerhandler; XML_CTYPE_MIXEDandXML_CTYPE_NAME, whose descriptions are empty;EXPAT_VERSION,version_infoandfeatures, although the XML security documentation already refers toEXPAT_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
Reactions are currently unavailable
Metadata
Metadata
Assignees
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
- StatusShow more project fieldsTodo
Activity
gh-156821: Fix inaccuracies in the xml.parsers.expat documentation (G…
[3.14] pythongh-156821: Fix inaccuracies in the xml.parsers.expat doc…
[3.13] gh-156821: Fix inaccuracies in the xml.parsers.expat documenta…
[3.14] gh-156821: Fix inaccuracies in the xml.parsers.expat documenta…
pythongh-156821: Fix inaccuracies in the xml.parsers.expat documentat…
[3.15] gh-156821: Fix inaccuracies in the xml.parsers.expat documenta…