Skip to content

Commit

Permalink
Apply suggestion since part.blob changes type in the loop
Browse files Browse the repository at this point in the history
Co-authored-by: Chatnoir Miki <[email protected]>
  • Loading branch information
bartbroere and AsterisMono authored Oct 24, 2024
1 parent 9124386 commit 0d616ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docxtpl/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ def render_footnotes(
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

Expand Down

0 comments on commit 0d616ad

Please sign in to comment.