イムtweepyで機能を使用しようと、「update_profile_background_image」とエラーが出ていますUnicodeDecodeError(tweepy)
Traceback (most recent call last):
File "XXX.py", line 1401, in <module>
psn_card.gen_twitter_bg(user_db)
File "XXX.py", line 972, in gen_twitter_bg
auth_api.update_profile_background_image(file)
File "build/bdist.linux-x86_64/egg/tweepy/api.py", line 346, in update_profile_background_image
headers, post_data = API._pack_image(filename, 800)
File "build/bdist.linux-x86_64/egg/tweepy/api.py", line 729, in _pack_image
body = '\r\n'.join(body)
UnicodeDecodeError: 'ascii' codec can't decode byte 0x89 in position 0: ordinal not in range(128)
問題がある:このlibに卵のファイル内にある、私はこの問題を解決する方法? これはtweepyのバグですか?
この機能は、ファイル(画像)を読み込み、POST(HTTP)経由でTwitter APIに送信する機能です。
エラーは、ロードしたイメージを操作しようとした時点で発生します。
# -- coding: utf-8 --
詳細をご覧ください。 update_profile_background_image()の呼び出しはどうなりますか?エラーがあるかもしれませんが、まだわかりません。 – naeg
一般的なリンク:http://docs.python.org/howto/unicode.html – Carpetsmoker