Handles blank keep-alive new lines
authorJosh Martone <jmartone@nyu.edu>
Thu, 15 Jun 2017 18:59:45 +0000 (14:59 -0400)
committerGitHub <noreply@github.com>
Thu, 15 Jun 2017 18:59:45 +0000 (14:59 -0400)
Added .strip() to read_line() to handle keep-alive new lines

tweepy/streaming.py

index 82a7ac2ebbfb029f01093067f647ef1a8c12effd..43aa82340be425279e8c5339cb35173d8b089f2f 100644 (file)
@@ -313,7 +313,7 @@ class Stream(object):
         while self.running and not resp.raw.closed:
             length = 0
             while not resp.raw.closed:
-                line = buf.read_line()
+                line = buf.read_line().strip()
                 if not line:
                     self.listener.keep_alive()  # keep-alive new lines are expected
                 elif line.strip().isdigit():