Skip to content

Incorrect and missing statements in the xml.sax documentation #156829

Description

@serhiy-storchaka

Several statements in the documentation of xml.sax do not match the behaviour, and a part of the API is not documented.

  • The keyword argument of parse() and parseString() is errorHandler, not error_handler, so the documented name raises TypeError.
  • The default value of the parser_list argument of make_parser() is (), not [].
  • The source of parse() can also be a system identifier, which is opened as a URL if it does not refer to an existing file.
  • The type of the declaration-handler property is given as xml.sax.sax2lib.DeclHandler, which does not exist, and the type of the dom-node property as the Java org.w3c.dom.Node.
  • Names are interned in a dictionary, not with a built-in intern function, which Python 3 does not have.
  • IncrementalParser is said to add three methods, but it adds four, and its parse() implementation uses prepareParser(), feed() and close(), not reset().
  • default_parser_list, SAXReaderNotAvailable, property_encoding, property_interning_dict, IncrementalParser.prepareParser(), XMLFilterBase.getParent() and setParent() are not documented.
  • It is not said that the parser based on Expat does not support the namespace-prefixes, validation and external-parameter-entities features, nor the declaration-handler, dom-node and encoding properties.
  • parse(), parseString(), AttributesImpl and XMLGenerator have no docstrings.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.13bugs and security fixes3.14bugs and security fixes3.15pre-release feature fixes, bugs and security fixes3.16new features, bugs and security fixesdocsDocumentation in the Doc dirtopic-XML

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions