This is an automated email from the ASF dual-hosted git repository. humbedooh pushed a commit to branch humbedooh/formatflowed-bytestring in repository https://gitbox.apache.org/repos/asf/incubator-ponymail.git
commit 8034fb339b19c5e0b68777b5fbccbae6a43e9d35 Author: Daniel Gruno <[email protected]> AuthorDate: Sat Aug 15 08:21:18 2020 +0200 convertToWrapped expects a bytestring Additionally, be more specific in our format=flowed search --- tools/archiver.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/archiver.py b/tools/archiver.py index fa052b4..7404214 100755 --- a/tools/archiver.py +++ b/tools/archiver.py @@ -326,8 +326,8 @@ class Archiver(object): # N.B. Also used by import-mbox.py mdatestring = time.strftime("%Y/%m/%d %H:%M:%S", time.gmtime(epoch)) body = self.msgbody(msg, verbose=args.verbose, ignore_body=args.ibody) try: - if 'content-type' in msg_metadata and msg_metadata['content-type'].find("flowed") != -1: - body = convertToWrapped(body, character_set="utf-8") + if 'content-type' in msg_metadata and 'format=flowed' in msg_metadata['content-type']: + body = convertToWrapped(bytes(body, 'utf-8'), character_set="utf-8") if isinstance(body, str): body = body.encode('utf-8') except Exception as err:
