Fix for newer version of httplib
authorPeter Reuterås <peter@reuteras.com>
Sun, 9 Oct 2011 10:35:01 +0000 (12:35 +0200)
committerPeter Reuterås <peter@reuteras.com>
Sun, 9 Oct 2011 10:35:01 +0000 (12:35 +0200)
httplib in python 2.7 requires that the lenght parameter is a string
and not an int.

tweepy/api.py

index dafb739ec6b6ecd269d2e58d2e48d90b5a3759b1..8f36e32355390c04c6fc22a3e89a13df49cc3728 100644 (file)
@@ -747,7 +747,7 @@ class API(object):
         # build headers
         headers = {
             'Content-Type': 'multipart/form-data; boundary=Tw3ePy',
-            'Content-Length': len(body)
+            'Content-Length': str(len(body))
         }
 
         return headers, body