]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-30365: Backport warnings and fix bugs in ElementTree. (#1581)
authorSerhiy Storchaka <storchaka@gmail.com>
Wed, 17 May 2017 07:08:11 +0000 (10:08 +0300)
committerGitHub <noreply@github.com>
Wed, 17 May 2017 07:08:11 +0000 (10:08 +0300)
commit09b52471f39ba280d836b945d47719c697af0b45
tree2d2c51ea7366f5641498e2cfbb6e983f85b80b55
parent800e4b7ad6b6f86c17408429852dfb47493d366e
bpo-30365: Backport warnings and fix bugs in ElementTree. (#1581)

Running Python with the -3 option now emits deprecation warnings for
getchildren() and getiterator() methods of the Element class in the
xml.etree.cElementTree module and when pass the html argument to
xml.etree.ElementTree.XMLParser().

Fixed a deprecation warning about the doctype() method of the
xml.etree.ElementTree.XMLParser class.  Now it is emitted only when
define the doctype() method in the subclass of XMLParser.

Fixed a bug in the test_bug_200708_close test method.  An EchoTarget
instance was incorrectly passed to XMLParser() as the html argument and
silently ignored.

Tests no longer failed when use the -m option for running only selected
test methods. Checking warnings now is more specific, warnings are
expected only when use deprecated features.
Lib/test/test_xml_etree.py
Lib/xml/etree/ElementTree.py
Misc/NEWS
Modules/_elementtree.c