From 0ac4e83531993187df16c05a886654e13574f136 Mon Sep 17 00:00:00 2001 From: Harmon Date: Fri, 19 Feb 2021 16:59:52 -0600 Subject: [PATCH] Stop allowing positional arguments for API.update_with_media Stop allowing positional arguments besides filename and status for API.update_with_media --- tweepy/api.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tweepy/api.py b/tweepy/api.py index a302d5f94..d310b1479 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -375,7 +375,7 @@ def create_media_metadata(self, media_id, alt_text, **kwargs): ) @payload('status') - def update_with_media(self, filename, status, *args, file=None, **kwargs): + def update_with_media(self, filename, status, *, file=None, **kwargs): """ :reference: https://developer.twitter.com/en/docs/tweets/post-and-engage/api-reference/post-statuses-update_with_media """ headers, post_data = API._pack_image(filename, 3072, @@ -383,8 +383,7 @@ def update_with_media(self, filename, status, *args, file=None, **kwargs): kwargs.update({'headers': headers, 'post_data': post_data}) return self.request( - 'POST', 'statuses/update_with_media', status, *args, - endpoint_parameters=( + 'POST', 'statuses/update_with_media', status, endpoint_parameters=( 'status', 'possibly_sensitive', 'in_reply_to_status_id', 'lat', 'long', 'place_id', 'display_coordinates' ), **kwargs