_read_loop really didn't seem right, but somehow kinda worked. It now works when...
authorAlanBell <alanbell@ubuntu.com>
Wed, 30 Mar 2011 19:52:49 +0000 (12:52 -0700)
committerAlanBell <alanbell@ubuntu.com>
Wed, 30 Mar 2011 19:52:49 +0000 (12:52 -0700)
tweepy/streaming.py

index 5ac12db346b7b5bd38044f592414d547738ffb56..dfa4ffa519b29bd27c9c4ec53c5676c4570654cd 100644 (file)
@@ -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