Unicode Emoji raise etree.XMLSyntaxError at etree.fromstring()
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxml |
Invalid
|
Undecided
|
Unassigned |
Bug Description
OS X 10.11.2(15C50)
Python : sys.version_
lxml.etree : (3, 5, 0, 0)
libxml used : (2, 9, 2)
libxml compiled : (2, 9, 2)
libxslt used : (1, 1, 28)
libxslt compiled : (1, 1, 28)
I want U+1F576 Sunglasses!
But this test.py won't worked.
```python
#!/usr/bin/env python3
import sys
from lxml import html, etree
print("%-20s: %s" % ('Python', sys.version_info))
print("%-20s: %s" % ('lxml.etree', etree.LXML_
print("%-20s: %s" % ('libxml used', etree.LIBXML_
print("%-20s: %s" % ('libxml compiled', etree.LIBXML_
print("%-20s: %s" % ('libxslt used', etree.LIBXSLT_
print("%-20s: %s" % ('libxslt compiled', etree.LIBXSLT_
uni = "<p>Unicode! \U0001F576 Sunglasses!</p>"
#t = html.fragment_
t = etree.fromstrin
print("B", etree.tostring(t))
print("U", etree.tostring(t, encoding=
```
```pytb
Traceback (most recent call last):
File "test.py", line 14, in <module>
t = etree.fromstrin
File "src/lxml/
File "src/lxml/
File "src/lxml/
File "src/lxml/
File "src/lxml/
File "src/lxml/
File "src/lxml/
```
I'm running into the same problem, but can verify that the same code works with Python 2.7.10, which should hopefully help narrow it down a little… :)