Change API.chunked_upload_init parameters to be keyword-only
authorHarmon <Harmon758@gmail.com>
Fri, 19 Feb 2021 16:29:35 +0000 (10:29 -0600)
committerHarmon <Harmon758@gmail.com>
Fri, 19 Feb 2021 16:29:35 +0000 (10:29 -0600)
Change media_category and additional_owners API.chunked_upload_init parameters to be keyword-only

tweepy/api.py

index 1ec8b429c05b090349e6eda745369e4812a02e25..3ebc5fe47a3abbb85f82eeb1a9503e14cc79a229 100644 (file)
@@ -387,7 +387,8 @@ class API:
         fp.seek(start)
 
         media_id = self.chunked_upload_init(
-            file_size, file_type, media_category, *args, **kwargs
+            file_size, file_type, media_category=media_category, *args,
+            **kwargs
         ).media_id
 
         min_chunk_size, remainder = divmod(file_size, 1000)
@@ -413,8 +414,9 @@ class API:
         return self.chunked_upload_finalize(media_id, *args, **kwargs)
 
     @payload('media')
-    def chunked_upload_init(self, total_bytes, media_type, media_category=None,
-                            additional_owners=None, *args, **kwargs):
+    def chunked_upload_init(self, total_bytes, media_type, *args,
+                            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
         """
         headers = {'Content-Type': 'application/x-www-form-urlencoded'}