bpo-29209: Remove old-deprecated features in ElementTree. (GH-6769)

Also make getchildren() and getiterator() emitting
a DeprecationWarning instead of PendingDeprecationWarning.
This commit is contained in:
Serhiy Storchaka 2018-07-24 12:03:34 +03:00 committed by GitHub
parent c5734998d9
commit 02ec92fa7b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 72 additions and 181 deletions

View file

@ -772,13 +772,13 @@ Element Objects
.. method:: getchildren()
.. deprecated:: 3.2
.. deprecated-removed:: 3.2 3.9
Use ``list(elem)`` or iteration.
.. method:: getiterator(tag=None)
.. deprecated:: 3.2
.. deprecated-removed:: 3.2 3.9
Use method :meth:`Element.iter` instead.
@ -888,7 +888,7 @@ ElementTree Objects
.. method:: getiterator(tag=None)
.. deprecated:: 3.2
.. deprecated-removed:: 3.2 3.9
Use method :meth:`ElementTree.iter` instead.
@ -1050,20 +1050,20 @@ XMLParser Objects
^^^^^^^^^^^^^^^^^
.. class:: XMLParser(html=0, target=None, encoding=None)
.. class:: XMLParser(*, target=None, encoding=None)
This class is the low-level building block of the module. It uses
:mod:`xml.parsers.expat` for efficient, event-based parsing of XML. It can
be fed XML data incrementally with the :meth:`feed` method, and parsing
events are translated to a push API - by invoking callbacks on the *target*
object. If *target* is omitted, the standard :class:`TreeBuilder` is used.
The *html* argument was historically used for backwards compatibility and is
now deprecated. If *encoding* [1]_ is given, the value overrides the
If *encoding* [1]_ is given, the value overrides the
encoding specified in the XML file.
.. deprecated:: 3.4
The *html* argument. The remaining arguments should be passed via
keyword to prepare for the removal of the *html* argument.
.. versionchanged:: 3.8
Parameters are now :ref:`keyword-only <keyword-only_parameter>`.
The *html* argument no longer supported.
.. method:: close()
@ -1072,13 +1072,6 @@ XMLParser Objects
this is the toplevel document element.
.. method:: doctype(name, pubid, system)
.. deprecated:: 3.2
Define the :meth:`TreeBuilder.doctype` method on a custom TreeBuilder
target.
.. method:: feed(data)
Feeds data to the parser. *data* is encoded data.