projects
/
tweepy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
11edfc5
)
Update tweepy/api.py
author
Fabian Kropfhamer
<54098356+fkropfhamer@users.noreply.github.com>
Tue, 22 Dec 2020 17:17:55 +0000
(18:17 +0100)
committer
GitHub
<noreply@github.com>
Tue, 22 Dec 2020 17:17:55 +0000
(18:17 +0100)
Co-authored-by: Harmon <Harmon758@gmail.com>
tweepy/api.py
patch
|
blob
|
blame
|
history
diff --git
a/tweepy/api.py
b/tweepy/api.py
index 0df8da3b2ec5e0eb9d57e1792f50a0cb29075ddf..66e95d262b8e00cb2546b4d3091363a445b8be63 100644
(file)
--- a/
tweepy/api.py
+++ b/
tweepy/api.py
@@
-220,10
+220,12
@@
class API(object):
:allowed_param:
"""
f = kwargs.pop('file', None)
+
h = None
- if f:
+ if f is not None:
+ location = f.tell()
h = f.read(32)
-
+ f.seek(location)
file_type = imghdr.what(filename, h=h) or mimetypes.guess_type(filename)[0]
if file_type == 'gif':
max_size = 14649