From 6a1e170b371bfd52716ae05d85c2f303065fc687 Mon Sep 17 00:00:00 2001 From: Robin Houston Date: Sat, 5 Mar 2011 16:15:19 +0000 Subject: [PATCH] Apply the auth before connecting, otherwise it will fail on reconnection when using OAuth (because the nonce has been used before, and the timestamp is no longer correct). --- tweepy/streaming.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tweepy/streaming.py b/tweepy/streaming.py index b10444d..73b632d 100644 --- a/tweepy/streaming.py +++ b/tweepy/streaming.py @@ -89,7 +89,6 @@ class Stream(object): def _run(self): # Authenticate url = "%s://%s%s" % (self.scheme, self.host, self.url) - self.auth.apply_auth(url, 'POST', self.headers, self.parameters) # Connect and process the stream error_counter = 0 @@ -104,6 +103,7 @@ class Stream(object): conn = httplib.HTTPConnection(self.host) else: conn = httplib.HTTPSConnection(self.host) + self.auth.apply_auth(url, 'POST', self.headers, self.parameters) conn.connect() conn.sock.settimeout(self.timeout) conn.request('POST', self.url, self.body, headers=self.headers) -- 2.25.1