From a9f9dc4fe1a6c7914fca0d7b0046aac60e0a5b7f Mon Sep 17 00:00:00 2001 From: kuttti Date: Wed, 12 Dec 2018 13:19:46 +0100 Subject: [PATCH] Update imapbackup.py Fix Error on Windows: "object of type 'cStringIO.StringO' has no len()" --- imapbackup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/imapbackup.py b/imapbackup.py index 465c911..3dad901 100644 --- a/imapbackup.py +++ b/imapbackup.py @@ -707,7 +707,8 @@ def _fixed_socket_read(self, size=-1): # Platform detection to enable socket patch if 'Darwin' in platform.platform() and '2.3.5' == platform.python_version(): socket._fileobject.read = _fixed_socket_read -if 'Windows' in platform.platform(): +# 20181212: Windows 10 + Python 2.7 doesn't need this fix (fix leads to error: object of type 'cStringIO.StringO' has no len()) +if 'Windows' in platform.platform() and '2.3.5' == platform.python_version(): socket._fileobject.read = _fixed_socket_read if __name__ == '__main__':