Specify file kwarg for API.update_profile_banner explicitly
authorHarmon <Harmon758@gmail.com>
Fri, 19 Feb 2021 17:23:39 +0000 (11:23 -0600)
committerHarmon <Harmon758@gmail.com>
Fri, 19 Feb 2021 17:23:39 +0000 (11:23 -0600)
tweepy/api.py

index d74e5a099e6332a4295dc9121b7f5db8785bfc87..4d2672b9e71d86d601df49b5147b1c9d39c2f226 100644 (file)
@@ -715,12 +715,11 @@ class API:
             ), post_data=post_data, headers=headers, **kwargs
         )
 
-    def update_profile_banner(self, filename, **kwargs):
+    def update_profile_banner(self, filename, *, file=None, **kwargs):
         """ :reference: https://developer.twitter.com/en/docs/accounts-and-users/manage-account-settings/api-reference/post-account-update_profile_banner
         """
-        f = kwargs.pop('file', None)
         headers, post_data = API._pack_image(filename, 700,
-                                             form_field='banner', f=f)
+                                             form_field='banner', f=file)
         return self.request(
             'POST', 'account/update_profile_banner', endpoint_parameters=(
                 'width', 'height', 'offset_left', 'offset_right'