You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DeprecationWarning when parse ElementTree with a doctype in 2.7 #74134
bpo-15083: Rewrite ElementTree tests in a cleaner and safer way
Superseder
bpo-30365: Backport warnings in ElementTree/cElementTree modules and fix bugs
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee='https://github.com/serhiy-storchaka'closed_at=<Date2017-05-18.17:58:55.506>created_at=<Date2017-03-30.15:03:07.869>labels= ['expert-XML', 'type-bug']
title='DeprecationWarning when parse ElementTree with a doctype in 2.7'updated_at=<Date2017-05-18.17:58:55.505>user='https://github.com/serhiy-storchaka'
DeprecationWarning is emitted when parse ElementTree with a doctype in 2.7.
$ python2.7 -Wa
Python 2.7.12 (default, Nov 19 2016, 06:48:10)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import xml.etree.ElementTree asET
>>> ET.XML('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html>text</html>')
/usr/lib/python2.7/xml/etree/ElementTree.py:1638: DeprecationWarning: This method of XMLParser is deprecated. Define doctype() method on the TreeBuilder target.
DeprecationWarning,
/usr/lib/python2.7/xml/etree/ElementTree.py:1638: DeprecationWarning: This method of XMLParser is deprecated. Define doctype() method on the TreeBuilder target.
DeprecationWarning,
<Element 'html' at 0xb7025b4c>
Activity
serhiy-storchaka commentedon Mar 30, 2017
DeprecationWarning is emitted when parse ElementTree with a doctype in 2.7.
serhiy-storchaka commentedon May 18, 2017
Fixed in bpo-30365.