Treat IncompleteRead as a disconnect or timeout, and reconnect.
authorTimo Ewalds <tewalds@google.com>
Wed, 22 Oct 2014 00:18:09 +0000 (20:18 -0400)
committerTimo Ewalds <tewalds@google.com>
Wed, 22 Oct 2014 00:28:35 +0000 (20:28 -0400)
tweepy/streaming.py

index c29222002b5f5b5aa3d459c3af7b56f755f5bb6a..68532b71122bc1f731f189504c27ce6e9cc82628 100644 (file)
@@ -182,7 +182,7 @@ class Stream(object):
                     self.snooze_time = self.snooze_time_step
                     self.listener.on_connect()
                     self._read_loop(resp)
-            except (Timeout, ssl.SSLError) as exc:
+            except (Timeout, ssl.SSLError, requests.compat.IncompleteRead) as exc:
                 # This is still necessary, as a SSLError can actually be
                 # thrown when using Requests
                 # If it's not time out treat it like any other exception