From 1bed75d814509f7816c92de665cf6966766c0883 Mon Sep 17 00:00:00 2001 From: Michael J Gruber Date: Tue, 4 Jun 2019 16:30:32 +0200 Subject: 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. --- alot/completion.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'alot') 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 -- cgit v1.2.3