lxml.builder.E doen't work with CDATA objects
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxml |
Fix Released
|
Low
|
scoder |
Bug Description
>>> from lxml.builder import E
>>> from lxml.etree import CDATA
>>> E.stuff(CDATA('Some stuff that needs to be in a CDATA section'))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/
(type(
TypeError: bad argument type: CDATA(<
Would be nice if it would for without having to make a custom ElementBuilder.
# version information
>>> print("%-20s: %s" % ('Python', sys.version_info))
Python : sys.version_
>>> print("%-20s: %s" % ('lxml.etree', etree.LXML_
lxml.etree : (3, 3, 1, 0)
>>> print("%-20s: %s" % ('libxml used', etree.LIBXML_
libxml used : (2, 7, 8)
>>> print("%-20s: %s" % ('libxml compiled', etree.LIBXML_
libxml compiled : (2, 7, 8)
>>> print("%-20s: %s" % ('libxslt used', etree.LIBXSLT_
libxslt used : (1, 1, 26)
>>> print("%-20s: %s" % ('libxslt compiled', etree.LIBXSLT_
libxslt compiled : (1, 1, 26)
Changed in lxml: | |
milestone: | none → 3.4 |
status: | Confirmed → Fix Committed |
Agreed. Should be easy to add, though. Want to give it a try? You can provide a pull request on github.