From f475b96685686cb1f5597ac063de950f4efb0c85 Mon Sep 17 00:00:00 2001 From: Lucas Hoffmann Date: Mon, 21 Aug 2017 23:20:42 +0200 Subject: Use cStringIO.StringIO to fix #1132 This undoes a small subset of the changes from fa3dd1b04567c4ea03fa658c3838b569531c79f5 and thus fixes #1132. The io.BytesIO object was not able to handle the unicode header names that where returned by envelope.construct_mail, which in turn did just copy them from the envelope header. --- alot/helper.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'alot/helper.py') diff --git a/alot/helper.py b/alot/helper.py index ce307875..1c569a23 100644 --- a/alot/helper.py +++ b/alot/helper.py @@ -10,6 +10,7 @@ from datetime import timedelta from datetime import datetime from collections import deque from io import BytesIO +from cStringIO import StringIO import logging import mimetypes import os @@ -606,7 +607,7 @@ def email_as_string(mail): :param mail: email to convert to string :rtype: str """ - fp = BytesIO() + fp = StringIO() g = Generator(fp, mangle_from_=False, maxheaderlen=78) g.flatten(mail) as_string = RFC3156_canonicalize(fp.getvalue()) -- cgit v1.2.3