summaryrefslogtreecommitdiff
path: root/alot/db/envelope.py
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2014-03-21 15:57:00 +0000
committerPatrick Totzke <patricktotzke@gmail.com>2014-03-21 15:57:00 +0000
commitee0a7db57c2734655746b1e5d3eac83b42f632f3 (patch)
treec651bde0ea3bc7b7bd40ed472e75717a30650827 /alot/db/envelope.py
parentaab05a05f759a1a70f033d1b9033930548df25c0 (diff)
ensure that Envelope.body is unicode string
Diffstat (limited to 'alot/db/envelope.py')
-rw-r--r--alot/db/envelope.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/alot/db/envelope.py b/alot/db/envelope.py
index 0c0d3150..a9c4fc7c 100644
--- a/alot/db/envelope.py
+++ b/alot/db/envelope.py
@@ -47,7 +47,7 @@ class Envelope(object):
"""tags to add after successful sendout"""
def __init__(
- self, template=None, bodytext=u'', headers=None, attachments=[],
+ self, template=None, bodytext=None, headers=None, attachments=[],
sign=False, sign_key=None, encrypt=False, tags=[]):
"""
:param template: if not None, the envelope will be initialised by
@@ -63,14 +63,12 @@ class Envelope(object):
:param tags: tags to add after successful sendout and saving this msg
:type tags: list of str
"""
- assert isinstance(bodytext, unicode)
logging.debug('TEMPLATE: %s' % template)
if template:
self.parse_template(template)
logging.debug('PARSED TEMPLATE: %s' % template)
logging.debug('BODY: %s' % self.body)
- if self.body is None:
- self.body = bodytext
+ self.body = bodytext or u''
self.headers = headers or {}
self.attachments = list(attachments)
self.sign = sign