From 0d616add8454db28e178459a2904e03a98ef1dc0 Mon Sep 17 00:00:00 2001 From: Bart Broere Date: Thu, 24 Oct 2024 07:27:59 +0200 Subject: [PATCH] Apply suggestion since part.blob changes type in the loop Co-authored-by: Chatnoir Miki --- docxtpl/template.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docxtpl/template.py b/docxtpl/template.py index a37dd71..d37911f 100644 --- a/docxtpl/template.py +++ b/docxtpl/template.py @@ -360,7 +360,7 @@ class DocxTemplate(object): for section in self.docx.sections: for part in section.part.package.parts: if part.content_type == 'application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml': - xml = self.patch_xml(part.blob.decode('utf8')) + xml = self.patch_xml(part.blob.decode('utf-8') if type(part.blob) is bytes else part.blob) xml = self.render_xml_part(xml, part, context, jinja_env) part._blob = xml