You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tweepy fails to upload the image because it can't guess the filetype using imghdr.what().
Possible Solution
Use mimetypes and/or magic as a fallback if imghdr fails.
Traceback
Traceback (most recent call last):
File "planetexpressbot.py", line 30, in <module>
media = api.media_upload('quote.jpg', f)
File "/usr/local/lib/python3.8/site-packages/tweepy/api.py", line 229, in media_upload
headers, post_data = API._pack_image(filename, max_size,
File "/usr/local/lib/python3.8/site-packages/tweepy/api.py", line 1392, in _pack_image
raise TweepError('Could not determine file type')
tweepy.error.TweepError: Could not determine file type
The text was updated successfully, but these errors were encountered:
I'm trying to upload a image using this code:
Expected Results
Tweepy uploads the image with the message "foo".
Actual Results
Tweepy fails to upload the image because it can't guess the filetype using imghdr.what().
Possible Solution
Use mimetypes and/or magic as a fallback if imghdr fails.
Traceback
The text was updated successfully, but these errors were encountered: