[New-bugs-announce] [issue14849] C implementation of ElementTree: Inheriting from Element breaks text member

Markus report at bugs.python.org
Fri May 18 12:13:19 CEST 2012


New submission from Markus <common at gmx.ch>:

Example Code to reproduce:

from xml.etree import ElementTree as etree
class xetree:
	cElement = etree.Element
	class Element(etree.Element):
		def __init__(self, tag, attrib=None):
			xetree.cElement.__init__(self, tag, attrib)

etree.Element = xetree.Element

e = etree.Element("test", {'foobar':'bar'})
e.text = "failure"
print(etree.tostring(e))
# will lack "failure"

So basic inheritance is broken.

----------
components: Library (Lib)
messages: 161043
nosy: cmn
priority: normal
severity: normal
status: open
title: C implementation of ElementTree: Inheriting from Element breaks text member
versions: Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14849>
_______________________________________


More information about the New-bugs-announce mailing list