From eed645c0c500d0919ecdf9d1753615e8345ac39b Mon Sep 17 00:00:00 2001 From: Jonathan Pyle Date: Fri, 29 Nov 2024 15:23:46 -0500 Subject: [PATCH] encode XML as bytes in render_footnotes() `part._blob` should have the class `bytes`. --- docxtpl/template.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docxtpl/template.py b/docxtpl/template.py index 0b81868..b246ca7 100644 --- a/docxtpl/template.py +++ b/docxtpl/template.py @@ -370,7 +370,7 @@ def render_footnotes( else part.blob ) xml = self.render_xml_part(xml, part, context, jinja_env) - part._blob = xml + part._blob = xml.encode("utf-8") def resolve_listing(self, xml):