[New-bugs-announce] [issue29948] DeprecationWarning when parse ElementTree with a doctype in 2.7

Serhiy Storchaka report at bugs.python.org
Thu Mar 30 11:03:07 EDT 2017


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 <report at bugs.python.org>
<http://bugs.python.org/issue29948>
_______________________________________


More information about the New-bugs-announce mailing list