From: Josh Martone Date: Thu, 15 Jun 2017 18:59:45 +0000 (-0400) Subject: Handles blank keep-alive new lines X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=176061133bd5aa1592f222834498daf28018db0c;p=tweepy.git Handles blank keep-alive new lines Added .strip() to read_line() to handle keep-alive new lines --- diff --git a/tweepy/streaming.py b/tweepy/streaming.py index 82a7ac2..43aa823 100644 --- a/tweepy/streaming.py +++ b/tweepy/streaming.py @@ -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():