Skip to content

Commit 816eaf4

Browse files
committed
lxml should only ever return an ASCII string as a str
See <http://lxml.de/FAQ.html#why-does-lxml-sometimes-return-str-values-for-text-in-python-2>
1 parent 84e8802 commit 816eaf4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

html5lib/treewalkers/lxmletree.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def ensure_str(s):
1515
elif isinstance(s, text_type):
1616
return s
1717
else:
18-
return s.decode("utf-8", "strict")
18+
return s.decode("ascii", "strict")
1919

2020

2121
class Root(object):

0 commit comments

Comments
 (0)