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

Lines changed: 1 addition & 1 deletion
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy