projects
/
tweepy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
73a97cf
)
added check if before reading file
author
Fabian Kropfhamer
<54098356+fkropfhamer@users.noreply.github.com>
Tue, 22 Dec 2020 16:49:57 +0000
(17:49 +0100)
committer
GitHub
<noreply@github.com>
Tue, 22 Dec 2020 16:49:57 +0000
(17:49 +0100)
tweepy/api.py
patch
|
blob
|
blame
|
history
diff --git
a/tweepy/api.py
b/tweepy/api.py
index a424a394e6f53a25b918161a09c45f3fa188bf88..0df8da3b2ec5e0eb9d57e1792f50a0cb29075ddf 100644
(file)
--- a/
tweepy/api.py
+++ b/
tweepy/api.py
@@
-220,7
+220,9
@@
class API(object):
:allowed_param:
"""
f = kwargs.pop('file', None)
- h = f.read(32)
+ h = None
+ if f:
+ h = f.read(32)
file_type = imghdr.what(filename, h=h) or mimetypes.guess_type(filename)[0]
if file_type == 'gif':