From b160ee5776f16b4ea59e5c07918b21b14550ad71 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Mon, 31 Oct 2016 00:12:34 -0300 Subject: [bug] message can also be a BytesIO Twisted 16.5 sends a BytesIO as message, which was unexpected in this types list. --- src/leap/bitmask/mail/imap/mailbox.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) -- cgit v1.2.3