Stop allowing positional arguments besides filename for API.media_upload
authorHarmon <Harmon758@gmail.com>
Fri, 19 Feb 2021 23:11:53 +0000 (17:11 -0600)
committerHarmon <Harmon758@gmail.com>
Fri, 19 Feb 2021 23:11:53 +0000 (17:11 -0600)
tweepy/api.py

index 34d89321374fc72a9ce2eb0958783d1e6cecd44e..81d1803160b3d6cd40a17ee93f92e9217b44dd55 100644 (file)
@@ -334,7 +334,7 @@ class API:
         )
 
     @payload('media')
-    def media_upload(self, filename, *args, file=None, **kwargs):
+    def media_upload(self, filename, *, file=None, **kwargs):
         """ :reference: https://developer.twitter.com/en/docs/media/upload-media/api-reference/post-media-upload
         """
         h = None
@@ -354,7 +354,7 @@ class API:
         kwargs.update({'headers': headers, 'post_data': post_data})
 
         return self.request(
-            'POST', 'media/upload', *args, endpoint_parameters=(
+            'POST', 'media/upload', endpoint_parameters=(
                 'media_category', 'additional_owners'
             ), upload_api=True, **kwargs
         )