summaryrefslogtreecommitdiff
path: root/alot
diff options
context:
space:
mode:
authorMichael J Gruber <github@grubix.eu>2019-06-04 16:30:32 +0200
committerPatrick Totzke <patricktotzke@gmail.com>2019-08-10 17:33:17 +0100
commit1bed75d814509f7816c92de665cf6966766c0883 (patch)
treeccaae259e4d0edad2704751a49acd695fc31d874 /alot
parenta935ab494aba253501758bc59a1f586ad39ed303 (diff)
ContactsCompletion: use db.utils.formataddr
email.utils.formataddr does more encoding than we need at this point - headers will be encoded when they get inserted anyway. Use db.utils.formataddr instead. Fixes #1378 Note that some tests need to be (and are) changed: The expectation of the old tests was to get a completely escaped result. Also, add an umlaut test.
Diffstat (limited to 'alot')
-rw-r--r--alot/completion.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/alot/completion.py b/alot/completion.py
index 83eab6a5..dcf1383d 100644
--- a/alot/completion.py
+++ b/alot/completion.py
@@ -14,6 +14,7 @@ from . import commands
from .buffers import EnvelopeBuffer
from .settings.const import settings
from .utils import argparse as cargparse
+from .db.utils import formataddr
from .helper import split_commandline
from .addressbook import AddressbookError
from .errors import CompletionError
@@ -248,7 +249,7 @@ class AbooksCompleter(Completer):
else:
returnlist = []
for name, addr in res:
- newtext = email.utils.formataddr((name, addr))
+ newtext = formataddr((name, addr))
returnlist.append((newtext, len(newtext)))
return returnlist