py3: textwrap.dedent requires unicode strings, encode after the fact

Also all the format arguments are unicode strings, *and* in the wisdom
of python3, you can % format a bytestring but not .format() it.
This commit is contained in:
Eli Schwartz 2019-05-09 13:49:56 -04:00
parent aa8efc504d
commit dc96af5763
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6

View File

@ -223,13 +223,13 @@ class DOCX(object):
@property
def containerrels(self):
return textwrap.dedent(b'''\
return textwrap.dedent('''\
<?xml version='1.0' encoding='utf-8'?>
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
<Relationship Id="rId3" Type="{APPPROPS}" Target="docProps/app.xml"/>
<Relationship Id="rId2" Type="{DOCPROPS}" Target="docProps/core.xml"/>
<Relationship Id="rId1" Type="{DOCUMENT}" Target="word/document.xml"/>
</Relationships>'''.format(**self.namespace.names))
</Relationships>'''.format(**self.namespace.names)).encode('utf-8')
@property
def websettings(self):