I may have the same problem. Here is some minimal code to see the bug:
from lxml import html from lxml import etree root = html.fragment_fromstring("<p>🐻</p>") print(etree.tostring(root))
Run it in Python3.9 and Python3.11 I got different results (both with lxml 4.9.2): (the one from Python3.9 is correct)
% python3.9 test.py b'<p>🐻</p>'
% python3.11 test.py b'<p>h t m l > </p>'
I may have the same problem. Here is some minimal code to see the bug:
from lxml import html fromstring( "<p>🐻</ p>") tostring( root))
from lxml import etree
root = html.fragment_
print(etree.
Run it in Python3.9 and Python3.11 I got different results (both with lxml 4.9.2):
(the one from Python3.9 is correct)
% python3.9 test.py
b'<p>🐻</p>'
% python3.11 test.py
b'<p>h t m l > </p>'