element generator factory fails with accents and other valid utf-8 characters
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxml |
Invalid
|
Undecided
|
Unassigned |
Bug Description
If I add text to the builder including accents or other special characters it fails.
Samples
E("tag","garçon")
E("tag"
Error
C:\Python27\
234 raise TypeError("bad argument type: %s(%r)" %
235 (type(item)
--> 236 v = t(elem, item)
237 if v:
238 get(type(v))(elem, v)
C:\Python27\
183 elem[-1].tail = (elem[-1].tail or "") + item
184 except IndexError:
--> 185 elem.text = (elem.text or "") + item
186
187 def add_cdata(elem, cdata):
C:\Python27\
C:\Python27\
C:\Python27\
C:\Python27\
Version Info:
Python : sys.version_
lxml.etree : (3, 4, 4, 0)
libxml used : (2, 9, 0)
libxml compiled : (2, 9, 0)
libxslt used : (1, 1, 28)
libxslt compiled : (1, 1, 28)
Pass Unicode strings instead or switch to Python 3.