lyricat / Hotot

A Twitter Client
http://hotot.org
GNU Lesser General Public License v3.0
482 stars 130 forks source link

status not urlencoded when updating with media #542

Open minacle opened 11 years ago

minacle commented 11 years ago

[Req] {"type":"POST","url":"https://upload.twitter.com/1/statuses/update_with_media.json","data":{"status":"테스트","include_entities":"1","oauth_consumer_key":"SCEdx4ZEOO68QDCTC7FFUQ","oauth_signature_method":"HMAC-SHA1","oauth_version":"1.0","oauth_timestamp":1365478544,"oauth_nonce":"2014204110018909","oauthtoken":"**","oauth_signature":"8RhcXty3KM2D6arDSRPXKWhjjc4="},"file":[["media","/home/mayu/Pictures/img_1600.jpg"]]} Exception in thread Thread-1: Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 552, in bootstrap_inner self.run() File "/usr/lib/python2.7/threading.py", line 505, in run self.__target(_self.args, *_self.__kwargs) File "/usr/lib/python2.7/dist-packages/hotot/agent.py", line 214, in wrap result = func(_args, **argkw) File "/usr/lib/python2.7/dist-packages/hotot/agent.py", line 224, in request result = _post(url, params, headers, files, additions) File "/usr/lib/python2.7/dist-packages/hotot/agent.py", line 298, in _post files_headers, files_data = utils.encode_multipart_formdata(params, files) File "/usr/lib/python2.7/dist-packages/hotot/utils.py", line 135, in encode_multipart_formdata key, value = str(key).encode('utf8'), str(value).encode('utf8') UnicodeEncodeError: 'latin-1' codec can't encode characters in position 0-2: ordinal not in range(256)