forked from mirror/django-mailbox
Fix PY3 compatibility of compression
This commit is contained in:
parent
aa9f230558
commit
cedef9d81c
1 changed files with 1 additions and 1 deletions
|
|
@ -387,7 +387,7 @@ class Mailbox(models.Model):
|
|||
if settings['compress_original_message']:
|
||||
with NamedTemporaryFile(suffix=".eml.gz") as fp_tmp:
|
||||
with gzip.GzipFile(fileobj=fp_tmp, mode="w") as fp:
|
||||
fp.write(message.as_string())
|
||||
fp.write(message.as_string().encode('utf-8'))
|
||||
msg.eml.save(
|
||||
"%s.eml.gz" % (uuid.uuid4(), ),
|
||||
File(fp_tmp),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue