Specify file kwarg for API.update_with_media explicitly
authorHarmon <Harmon758@gmail.com>
Fri, 19 Feb 2021 22:57:19 +0000 (16:57 -0600)
committerHarmon <Harmon758@gmail.com>
Fri, 19 Feb 2021 22:57:19 +0000 (16:57 -0600)
tweepy/api.py

index b36d0f7ea099f2db726558e4bc47d6842662b356..2bf484a91122be78c05ff7fe3b5551231f868b55 100644 (file)
@@ -375,12 +375,11 @@ class API:
         )
 
     @payload('status')
-    def update_with_media(self, filename, *args, **kwargs):
+    def update_with_media(self, filename, *args, file=None, **kwargs):
         """ :reference: https://developer.twitter.com/en/docs/tweets/post-and-engage/api-reference/post-statuses-update_with_media
         """
-        f = kwargs.pop('file', None)
         headers, post_data = API._pack_image(filename, 3072,
-                                             form_field='media[]', f=f)
+                                             form_field='media[]', f=file)
         kwargs.update({'headers': headers, 'post_data': post_data})
 
         return self.request(