summaryrefslogtreecommitdiff
path: root/scripting
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-06-17 11:08:15 +0100
committerFridrich Strba <fridrich@documentfoundation.org>2013-06-18 20:51:52 +0000
commit540a681e4d6ed0d88a542c843dbf534fb661abf8 (patch)
tree7218d13d91f433d2ea07240f03d9c0cc27d0c620 /scripting
parentc5e55de0845e16896444e2e01a99c9a7055bc868 (diff)
Resolves: fdo#55411 python 2 vs 3 str/bytes encoding issues
Change-Id: Ic1aac1609f3a1fcbd0af9a1c9ecc07a735c8785a (cherry picked from commit 06f22f5ae0eafe094b280f03c770eebdbb33d403) Reviewed-on: https://gerrit.libreoffice.org/4350 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
Diffstat (limited to 'scripting')
-rwxr-xr-xscripting/source/pyprov/mailmerge.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/scripting/source/pyprov/mailmerge.py b/scripting/source/pyprov/mailmerge.py
index 18b476c26a17..f70f034c3569 100755
--- a/scripting/source/pyprov/mailmerge.py
+++ b/scripting/source/pyprov/mailmerge.py
@@ -239,11 +239,14 @@ class PyMailSMTPService(unohelper.Base, XSmtpService):
encode_base64(msgattachment)
fname = attachment.ReadableName
try:
- fname.encode('ascii')
+ msgattachment.add_header('Content-Disposition', 'attachment', \
+ filename=fname)
except:
- fname = ('utf-8','',fname.encode('utf-8'))
- msgattachment.add_header('Content-Disposition', 'attachment', \
- filename=fname)
+ msgattachment.add_header('Content-Disposition', 'attachment', \
+ filename=('utf-8','',fname))
+ if dbg:
+ print(("PyMailSMTPService attachmentheader: ", str(msgattachment)), file=dbgout)
+
msg.attach(msgattachment)
uniquer = {}