feeds: make BS's output bytes for lxml's sake

master
pictuga 2020-04-05 20:46:04 +02:00
parent 3617f86e9d
commit 568e7d7dd2
1 changed files with 1 additions and 1 deletions

View File

@ -442,7 +442,7 @@ class ParserHTML(ParserXML):
def parse(self, raw):
parser = etree.HTMLParser(remove_blank_text=True) # remove_blank_text needed for pretty_print
return etree.fromstring(BeautifulSoup(raw, 'lxml').prettify(), parser)
return etree.fromstring(BeautifulSoup(raw, 'lxml').prettify('utf-8'), parser)
def tostring(self, encoding='unicode', **k):
return lxml.html.tostring(self.root, encoding=encoding, **k)