These versions of python include the port number in the host header.
Twitter will send us a 301 when a host is provided in this manner.
To avoid this redirect this patch manually sets the host w/o the port number.
Fixes issue #12
else:
self.host = api.host
+ # Manually set Host header to fix an issue in python 2.5
+ # or older where Host is set including the 443 port.
+ # This causes Twitter to issue 301 redirect.
+ # See Issue http://github.com/joshthecoder/tweepy/issues/#issue/12
+ self.headers['Host'] = self.host
+
def build_parameters(self, args, kargs):
self.parameters = {}
for idx, arg in enumerate(args):