projects
/
tweepy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
af6308c
)
added transformation to bytes
author
fkropfhamer
<fabian.kropfhamer@gmail.com>
Mon, 10 Aug 2020 10:40:29 +0000
(12:40 +0200)
committer
fkropfhamer
<fabian.kropfhamer@gmail.com>
Mon, 10 Aug 2020 10:40:29 +0000
(12:40 +0200)
tweepy/api.py
patch
|
blob
|
blame
|
history
diff --git
a/tweepy/api.py
b/tweepy/api.py
index 38b7a2e0a8dafceeb87268abe3fffc7c0eb5a73e..a424a394e6f53a25b918161a09c45f3fa188bf88 100644
(file)
--- a/
tweepy/api.py
+++ b/
tweepy/api.py
@@
-220,8
+220,9
@@
class API(object):
:allowed_param:
"""
f = kwargs.pop('file', None)
+ h = f.read(32)
- file_type = imghdr.what(filename,
f
) or mimetypes.guess_type(filename)[0]
+ file_type = imghdr.what(filename,
h=h
) or mimetypes.guess_type(filename)[0]
if file_type == 'gif':
max_size = 14649
else: