From 176061133bd5aa1592f222834498daf28018db0c Mon Sep 17 00:00:00 2001 From: Josh Martone Date: Thu, 15 Jun 2017 14:59:45 -0400 Subject: [PATCH] Handles blank keep-alive new lines Added .strip() to read_line() to handle keep-alive new lines --- tweepy/streaming.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(): -- 2.25.1