Skip to content

Conversation

@jhpyle
Copy link
Contributor

@jhpyle jhpyle commented Nov 29, 2024

I got an error from docxcompose.composer.add_footnotes() after upgrading docxtpl to 0.19.0.

ValueError: Unicode strings with encoding declaration are not supported. Please use bytes input or XML fragments without declaration.

I was able to avoid this error by making the change in this pull request, which ensures that the modified XML is written back to the docx document as bytes.

I'm not an authority on whether part._blob should be bytes or not, but it seems that way based on how this change fixes the problem I was having with docxcompose.

`part._blob` should have the class `bytes`.
@elapouya elapouya merged commit def1205 into elapouya:master Dec 29, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants