Skip to content
This repository has been archived by the owner on Apr 16, 2022. It is now read-only.

Lxml etree serialzation io_encoder error workaround #99

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sgniedoj
Copy link

@sgniedoj sgniedoj commented Dec 17, 2021

Description

Adds "encoding" parameter to MailMerge.write

Motivation and Context

Calling MailMerge.write(file) occasionally causes lxml.etree.SerialisationError: IO_ENCODER exception.
Adding encoding='UTF-8' to xml = etree.tostring(self.parts[zi].getroot(), encoding='UTF-8') eliminates the problem.

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant