[offlineimap] Crash on OSX Yosemite python 2.7.6 (latency) (#205)

S├ębastien Gross notifications at github.com
Tue Nov 3 23:02:03 GMT 2015

This patch work for me:

modified   offlineimap/imaplib2.py
old mode 100644
new mode 100755
@@ -578,7 +578,11 @@ class IMAP4(object):
         Close I/O established in "open"."""
-            self.sock.shutdown(socket.SHUT_RDWR)
+            self.sock.shutdown(socket.SHUT_WR)
+            try:
+                self.sock.shutdown(socket.SHUT_RD)
+            except:
+                pass
         except OSError as e:
             # The server might already have closed the connection
             if e.errno != errno.ENOTCONN:

This is correct since the `LOGOUT` command has already been sent and this bug seems to be MacOSX specific I guess this is because internally `SHUT_RDWR` is done in 2 steps.

What I don't understand is that in V6.5.7 the behaviour is different (i haven't diff all the code though).

>From Python doc:

> Shut down one or both halves of the connection. If how is SHUT_RD, further
> receives are disallowed. If how is SHUT_WR, further sends are disallowed. If
> how is SHUT_RDWR, further sends and receives > are disallowed. Depending on
> the platform, shutting down one half of the connection can also close the
> opposite half (e.g. on Mac OS X, shutdown(SHUT_WR) does not allow further
> reads on the other end of the connection).

Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/offlineimap-project/attachments/20151103/6fc6b618/attachment-0003.html>

More information about the OfflineIMAP-project mailing list