Commit 0097801b authored by Aaron1011's avatar Aaron1011
Browse files

Merge pull request #450 from 7kry/master

Fix tweepy.API.update_with_media with unicode filename
parents ffed4228 caf15a92
......@@ -4,6 +4,7 @@
import os
import mimetypes
import urllib
from tweepy.binder import bind_api
from tweepy.error import TweepError
......@@ -788,6 +789,9 @@ class API(object):
if file_type not in ['image/gif', 'image/jpeg', 'image/png']:
raise TweepError('Invalid file type for image: %s' % file_type)
if isinstance(filename, unicode):
filename = filename.encode("utf-8")
filename = urllib.quote(filename)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment