summaryrefslogtreecommitdiff
path: root/alot/commands/globals.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2018-07-24 16:39:31 -0700
committerDylan Baker <dylan@pnwbakers.com>2018-07-25 09:12:03 -0700
commit6f16c8f4c985ed0b31fd5998749c09a6982c3e54 (patch)
tree0f79a9282902b8c14faf7fe2400ff32adfade477 /alot/commands/globals.py
parent4cba47a8143059a68c904e40e575fc4d493bf6de (diff)
commands/globals: Convert Address to string for email.utils
Email utils apparently assumes it's getting a string, and calls encode directly. This can only be hit if you have a single account configured, not with multiple accounts. Fixes #1277
Diffstat (limited to 'alot/commands/globals.py')
-rw-r--r--alot/commands/globals.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/alot/commands/globals.py b/alot/commands/globals.py
index 0f1d6e26..9ebf2859 100644
--- a/alot/commands/globals.py
+++ b/alot/commands/globals.py
@@ -818,7 +818,8 @@ class ComposeCommand(Command):
accounts = settings.get_accounts()
if len(accounts) == 1:
a = accounts[0]
- fromstring = email.utils.formataddr((a.realname, a.address))
+ fromstring = email.utils.formataddr(
+ (a.realname, str(a.address)))
self.envelope.add('From', fromstring)
else:
cmpl = AccountCompleter()