objectify.E.foo(CDATA('')) doesn't work

Bug #1726490 reported by Paul Winkler
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lxml
Confirmed
Wishlist
Unassigned

Bug Description

`builder.E(tag, cdata)` was fixed in #1330525, but `objectify.E(tag, cdata)` doesn't work.
Checked in 4.1.0, 3.8.0, and 3.3.6. Compare:

```
In [32]: for module in objectify, builder:
    ...: print tostring(module.E('b', etree.CDATA('hello %s' % module.__name__)))
    ...:

<b xmlns:py="http://codespeak.net/lxml/objectify/pytype" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" py:pytype="str">&lt;lxml.etree.CDATA object at 0x7f71a042d708&gt;</b>
<b><![CDATA[hello lxml.builder]]></b>

In [41]: print("%-20s: %s" % ('Python', sys.version_info))
    ...: print("%-20s: %s" % ('lxml.etree', etree.LXML_VERSION))
    ...: print("%-20s: %s" % ('libxml used', etree.LIBXML_VERSION))
    ...: print("%-20s: %s" % ('libxml compiled', etree.LIBXML_COMPILED_VERSION))
    ...: print("%-20s: %s" % ('libxslt used', etree.LIBXSLT_VERSION))
    ...: print("%-20s: %s" % ('libxslt compiled', etree.LIBXSLT_COMPILED_VERSION))
    ...: ## -----
    ...:
Python : sys.version_info(major=2, minor=7, micro=12, releaselevel='final', serial=0)
lxml.etree : (4, 1, 0, 0)
libxml used : (2, 9, 5)
libxml compiled : (2, 9, 5)
libxslt used : (1, 1, 30)
libxslt compiled : (1, 1, 30)
```

Revision history for this message
scoder (scoder) wrote :

Probably very easy to implement as an additional input value type. Pull request welcome.

Changed in lxml:
status: New → Triaged
scoder (scoder)
Changed in lxml:
importance: Undecided → Wishlist
status: Triaged → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.