From da7a5da595dd0bfc818b0bd519a1020f10addaf8 Mon Sep 17 00:00:00 2001 From: AlanBell Date: Wed, 30 Mar 2011 12:52:49 -0700 Subject: [PATCH] _read_loop really didn't seem right, but somehow kinda worked. It now works when pointed at user streams too. --- tweepy/streaming.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/tweepy/streaming.py b/tweepy/streaming.py index 5ac12db..dfa4ffa 100644 --- a/tweepy/streaming.py +++ b/tweepy/streaming.py @@ -136,26 +136,20 @@ class Stream(object): raise exception def _read_loop(self, resp): - data = '' - while self.running: + while self.running: if resp.isclosed(): break # read length - length = '' + data = '' while True: c = resp.read(1) if c == '\n': break - length += c - length = length.strip() - if length.isdigit(): - length = int(length) - else: - continue + data += c + data = data.strip() # read data and pass into listener - data = resp.read(length) if self.listener.on_data(data) is False: self.running = False -- 2.25.1