From 1e1f056053d2f25c7c13f7f75ae9f3f685b2ea28 Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Sat, 11 Jul 2020 20:20:50 +0000 Subject: [PATCH] Changed the subclass of lxml.html.clean.Cleaner() to adapt to changes in the superclass in v4.5.2 - Legacy-Id: 18146 --- ietf/utils/html.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ietf/utils/html.py b/ietf/utils/html.py index 1630c8acc..727ddac1a 100644 --- a/ietf/utils/html.py +++ b/ietf/utils/html.py @@ -57,6 +57,10 @@ def sanitize_fragment(html): class Cleaner(lxml.html.clean.Cleaner): charset = 'utf-8' + def __init__(self, charset='utf-8', **kw): + self.charset = charset + super(Cleaner, self).__init__(**kw) + # Copied from lxml 4.2.0 and modified to insert charset meta: def clean_html(self, html): result_type = type(html)