]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-33187: Document 3.9 changes to xml.etree.ElementInclude.include (GH-20438)
authorShantanu <hauntsaninja@users.noreply.github.com>
Mon, 8 Jun 2020 14:11:44 +0000 (07:11 -0700)
committerGitHub <noreply@github.com>
Mon, 8 Jun 2020 14:11:44 +0000 (16:11 +0200)
Looks like the merging of bpo-33187 and bpo-20928 was racy, resulting in
this change going undocumented.

Doc/library/xml.etree.elementtree.rst

index 658bc3a54f86e560a0b6967567f0bc635ca0c5cb..2085a85927e460a786a825da75012f999177cb34 100644 (file)
@@ -816,16 +816,25 @@ Functions
    loader fails, it can return None or raise an exception.
 
 
-.. function:: xml.etree.ElementInclude.include( elem, loader=None)
+.. function:: xml.etree.ElementInclude.include( elem, loader=None, base_url=None, \
+                                                max_depth=6)
 
    This function expands XInclude directives.  *elem* is the root element.  *loader* is
    an optional resource loader.  If omitted, it defaults to :func:`default_loader`.
    If given, it should be a callable that implements the same interface as
-   :func:`default_loader`.  Returns the expanded resource.  If the parse mode is
+   :func:`default_loader`.  *base_url* is base URL of the original file, to resolve
+   relative include file references.  *max_depth* is the maximum number of recursive
+   inclusions.  Limited to reduce the risk of malicious content explosion. Pass a
+   negative value to disable the limitation.
+
+   Returns the expanded resource.  If the parse mode is
    ``"xml"``, this is an ElementTree instance.  If the parse mode is "text",
    this is a Unicode string.  If the loader fails, it can return None or
    raise an exception.
 
+   .. versionadded:: 3.9
+      The *base_url* and *max_depth* parameters.
+
 
 .. _elementtree-element-objects: