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

tweepy/api.py

index f7201994509b5fded4b8d33c5ab153bdda004fe9..801b5ad9e3274da31ec2e6911d9f6582ec3716a1 100644 (file)
@@ -349,8 +349,8 @@ class API:
             file_type = mimetypes.guess_type(filename)[0]
 
         if chunked or file_type.startswith('video/'):
-            return self.chunked_upload(filename, file=file,
-                                       file_type=file_type, *args, **kwargs)
+            return self.chunked_upload(filename, *args, file=file,
+                                       file_type=file_type, **kwargs)
         else:
             return self.simple_upload(filename, file=file, **kwargs)
 
@@ -375,9 +375,8 @@ class API:
             upload_api=True, **kwargs
         )
 
-    def chunked_upload(self, filename, file=None, file_type=None,
-                       media_category=None, additional_owners=None, *args,
-                       **kwargs):
+    def chunked_upload(self, filename, *args, file=None, file_type=None,
+                       media_category=None, additional_owners=None, **kwargs):
         """ :reference https://developer.twitter.com/en/docs/media/upload-media/uploading-media/chunked-media-upload
         """
         fp = file or open(filename, 'rb')