Skip to content

Commit 301f0d4

Browse files
authored
bpo-33187: Document 3.9 changes to xml.etree.ElementInclude.include (GH-20438)
Looks like the merging of bpo-33187 and bpo-20928 was racy, resulting in this change going undocumented.
1 parent 63fc55b commit 301f0d4

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Doc/library/xml.etree.elementtree.rst

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -816,16 +816,25 @@ Functions
816816
loader fails, it can return None or raise an exception.
817817

818818

819-
.. function:: xml.etree.ElementInclude.include( elem, loader=None)
819+
.. function:: xml.etree.ElementInclude.include( elem, loader=None, base_url=None, \
820+
max_depth=6)
820821

821822
This function expands XInclude directives. *elem* is the root element. *loader* is
822823
an optional resource loader. If omitted, it defaults to :func:`default_loader`.
823824
If given, it should be a callable that implements the same interface as
824-
:func:`default_loader`. Returns the expanded resource. If the parse mode is
825+
:func:`default_loader`. *base_url* is base URL of the original file, to resolve
826+
relative include file references. *max_depth* is the maximum number of recursive
827+
inclusions. Limited to reduce the risk of malicious content explosion. Pass a
828+
negative value to disable the limitation.
829+
830+
Returns the expanded resource. If the parse mode is
825831
``"xml"``, this is an ElementTree instance. If the parse mode is "text",
826832
this is a Unicode string. If the loader fails, it can return None or
827833
raise an exception.
828834

835+
.. versionadded:: 3.9
836+
The *base_url* and *max_depth* parameters.
837+
829838

830839
.. _elementtree-element-objects:
831840

0 commit comments

Comments
 (0)