Update imapbackup.py

Fix Error on Windows: "object of type 'cStringIO.StringO' has no len()"
This commit is contained in:
kuttti 2018-12-12 13:19:46 +01:00 committed by GitHub
parent 34f91dca13
commit a9f9dc4fe1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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__':