diff options
author | Anton Khirnov <anton@khirnov.net> | 2021-01-16 10:49:06 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2021-01-16 10:49:06 +0100 |
commit | 3fb4d66b584beb3fc91fc22708cd83b125b567d9 (patch) | |
tree | 93c502868e778dd8c36fb06b06f09a831622af55 /alot/commands/envelope.py | |
parent | b1d0512f0e20b709858151818ddc508fd00dfe4a (diff) |
helper: get rid of decode_string()
It just adds unnecessary type confusion.
In most places where it is used, the types are always str, so it does
nothing. In the few others, the encoding/decoding is better handled
explicitly.
Diffstat (limited to 'alot/commands/envelope.py')
-rw-r--r-- | alot/commands/envelope.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/alot/commands/envelope.py b/alot/commands/envelope.py index 914829eb..1f806581 100644 --- a/alot/commands/envelope.py +++ b/alot/commands/envelope.py @@ -23,7 +23,6 @@ from .. import crypto from ..account import SendingMailFailed, StoreMailError from ..db.errors import DatabaseError from ..errors import GPGProblem -from ..helper import string_decode from ..settings.const import settings from ..settings.errors import NoMatchingAccount from ..utils import argparse as cargparse @@ -357,8 +356,8 @@ class EditCommand(Command): # get input # tempfile will be removed on buffer cleanup enc = settings.get('editor_writes_encoding') - with open(self.envelope.tmpfile.name) as f: - template = string_decode(f.read(), enc) + with open(self.envelope.tmpfile.name, 'rb') as f: + template = f.read().decode(enc) # call post-edit translate hook translate = settings.get_hook('post_edit_translate') |