Stop allowing positional arguments for API.chunked_upload_init
authorHarmon <Harmon758@gmail.com>
Fri, 19 Feb 2021 16:31:40 +0000 (10:31 -0600)
committerHarmon <Harmon758@gmail.com>
Fri, 19 Feb 2021 16:31:40 +0000 (10:31 -0600)
Stop allowing positional arguments besides total_bytes and media_type for API.chunked_upload_init

tweepy/api.py

index 3ebc5fe47a3abbb85f82eeb1a9503e14cc79a229..1d14f33315e82856fdc419ce177b71dedbca317e 100644 (file)
@@ -387,8 +387,7 @@ class API:
         fp.seek(start)
 
         media_id = self.chunked_upload_init(
-            file_size, file_type, media_category=media_category, *args,
-            **kwargs
+            file_size, file_type, media_category=media_category, **kwargs
         ).media_id
 
         min_chunk_size, remainder = divmod(file_size, 1000)
@@ -414,7 +413,7 @@ class API:
         return self.chunked_upload_finalize(media_id, *args, **kwargs)
 
     @payload('media')
-    def chunked_upload_init(self, total_bytes, media_type, *args,
+    def chunked_upload_init(self, total_bytes, media_type, *,
                             media_category=None, additional_owners=None,
                             **kwargs):
         """ :reference https://developer.twitter.com/en/docs/twitter-api/v1/media/upload-media/api-reference/post-media-upload-init
@@ -432,8 +431,8 @@ class API:
             post_data['additional_owners'] = list_to_csv(additional_owners)
 
         return self.request(
-            'POST', 'media/upload', *args, headers=headers,
-            post_data=post_data, upload_api=True, **kwargs
+            'POST', 'media/upload', headers=headers, post_data=post_data,
+            upload_api=True, **kwargs
         )
 
     def chunked_upload_append(self, media_id, media, segment_index,