New submission from 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 as ET >>> 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> ---------- assignee: serhiy.storchaka components: XML messages: 290846 nosy: eli.bendersky, scoder, serhiy.storchaka priority: normal severity: normal stage: needs patch status: open title: DeprecationWarning when parse ElementTree with a doctype in 2.7 type: behavior versions: Python 2.7 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29948> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com