From 626c5c5c0638455d5948ef135cc7ededacdfc328 Mon Sep 17 00:00:00 2001 From: Harmon Date: Thu, 14 Jan 2021 10:21:07 -0600 Subject: [PATCH] Remove unnecessary os.path.basename usage in API.chunked_upload --- tweepy/api.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tweepy/api.py b/tweepy/api.py index 800bf97..91456bc 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -4,7 +4,6 @@ import imghdr import mimetypes -import os from tweepy.binder import bind_api, pagination from tweepy.error import TweepError @@ -278,9 +277,8 @@ class API: for segment_index in range(segments): # The APPEND command returns an empty response body self.chunked_upload_append( - media_id, - (os.path.basename(filename), fp.read(chunk_size)), - segment_index, *args, **kwargs + media_id, (filename, fp.read(chunk_size)), segment_index, + *args, **kwargs ) fp.close() -- 2.25.1