From af6308ca499648b5f8664732955d406d9f2dd247 Mon Sep 17 00:00:00 2001 From: fkropfhamer Date: Sat, 8 Aug 2020 19:31:31 +0200 Subject: [PATCH] fixed bug for no saved file --- tweepy/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tweepy/api.py b/tweepy/api.py index 4a2599c..38b7a2e 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -221,7 +221,7 @@ class API(object): """ f = kwargs.pop('file', None) - file_type = imghdr.what(filename) or mimetypes.guess_type(filename)[0] + file_type = imghdr.what(filename, f) or mimetypes.guess_type(filename)[0] if file_type == 'gif': max_size = 14649 else: -- 2.25.1