Revert "Don't add 'delimited=length' to self.parameters"
authorAaron Hill <aa1ronham@gmail.com>
Tue, 8 Apr 2014 19:51:02 +0000 (15:51 -0400)
committerAaron Hill <aa1ronham@gmail.com>
Tue, 8 Apr 2014 19:51:02 +0000 (15:51 -0400)
This reverts commit 4374ec2f0b5030a3d234d8ee3d60e559e2ef3910.
Until I figure out what's going on with 'delimited=length', I'm going to
leave things as-is.

tweepy/streaming.py

index d7a6b6c0c8e43459cbb182d0100762fc7e12ca09..33f1169339e9b3cb9868456f28120f78fed8bffe 100644 (file)
@@ -242,7 +242,7 @@ class Stream(object):
 
     def userstream(self, stall_warnings=False, _with=None, replies=None,
             track=None, locations=None, async=False, encoding='utf8'):
-        self.parameters = {}
+        self.parameters = {'delimited': 'length'}
         if self.running:
             raise TweepError('Stream object already connected!')
         self.url = '/%s/user.json?delimited=length' % STREAM_VERSION
@@ -263,7 +263,7 @@ class Stream(object):
         self._start(async)
 
     def firehose(self, count=None, async=False):
-        self.parameters = {}
+        self.parameters = {'delimited': 'length'}
         if self.running:
             raise TweepError('Stream object already connected!')
         self.url = '/%s/statuses/firehose.json?delimited=length' % STREAM_VERSION
@@ -272,14 +272,14 @@ class Stream(object):
         self._start(async)
 
     def retweet(self, async=False):
-        self.parameters = {}
+        self.parameters = {'delimited': 'length'}
         if self.running:
             raise TweepError('Stream object already connected!')
         self.url = '/%s/statuses/retweet.json?delimited=length' % STREAM_VERSION
         self._start(async)
 
     def sample(self, async=False):
-        self.parameters = {}
+        self.parameters = {'delimited': 'length'}
         if self.running:
             raise TweepError('Stream object already connected!')
         self.url = '/%s/statuses/sample.json?delimited=length' % STREAM_VERSION
@@ -306,6 +306,7 @@ class Stream(object):
         if languages:
             self.parameters['language'] = ','.join(map(str, languages))
         self.body = urlencode_noplus(self.parameters)
+        self.parameters['delimited'] = 'length'
         self._start(async)
 
     def disconnect(self):