summaryrefslogtreecommitdiff
path: root/src/leap
diff options
context:
space:
mode:
authorVictor Shyba <victor1984@riseup.net>2016-10-31 00:12:34 -0300
committerKali Kaneko (leap communications) <kali@leap.se>2016-11-03 14:28:15 +0100
commitb160ee5776f16b4ea59e5c07918b21b14550ad71 (patch)
treed9fc932f4aa0a86527aab2d9589b064b25ca128c /src/leap
parent06d985069a18d7e165cc781996d2f8e9238c2278 (diff)
[bug] message can also be a BytesIO
Twisted 16.5 sends a BytesIO as message, which was unexpected in this types list.
Diffstat (limited to 'src/leap')
-rw-r--r--src/leap/bitmask/mail/imap/mailbox.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/leap/bitmask/mail/imap/mailbox.py b/src/leap/bitmask/mail/imap/mailbox.py
index 5e4fa6a5..836b38fd 100644
--- a/src/leap/bitmask/mail/imap/mailbox.py
+++ b/src/leap/bitmask/mail/imap/mailbox.py
@@ -19,6 +19,7 @@ IMAP Mailbox.
"""
import re
import os
+import io
import cStringIO
import StringIO
import time
@@ -390,7 +391,8 @@ class IMAPMailbox(object):
# A better solution will probably involve implementing MULTIAPPEND
# extension or patching imap server to support pipelining.
- if isinstance(message, (cStringIO.OutputType, StringIO.StringIO)):
+ if isinstance(message,
+ (cStringIO.OutputType, StringIO.StringIO, io.BytesIO)):
message = message.getvalue()
leap_assert_type(message, basestring)