lxml/lxml — pull request #146 by zubchick (2014-11-21 13:54:58+00:00)
Title: CDATA support in _setTailText

Current version of ```lxml``` does not support wrapping ```_Element.tail``` to ```CDATA```.

```python
>>> from lxml import etree
>>> etree.__version__
u'3.4.1'
>>> a = 'leftinright'
>>> xml = etree.fromstring(a)
>>> h = xml.find('h')
>>> h.tail
'right'
>>> h.text
'in'
>>> h.text = etree.CDATA(h.text)
>>> h.tail = etree.CDATA(h.tail)
Traceback (most recent call last):
File "", line 1, in
File "lxml.etree.pyx", line 959, in lxml.etree._Element.tail.__set__ (src/lxml/lxml.etree.c:46540)
File "apihelpers.pxi", line 706, in lxml.etree._setTailText (src/lxml/lxml.etree.c:21071)
File "apihelpers.pxi", line 1391, in lxml.etree._utf8 (src/lxml/lxml.etree.c:27146)
TypeError: Argument must be bytes or unicode, got 'CDATA'
```