当使用 pywikipedia 在我的 wiki 上上传图像时,无论图像是什么,我都会收到以下错误:
ERROR: UnicodeDecodeError: 'ascii' codec can't decode byte 0xff in position 687: ordinal not in range(128)
我的环境信息:
frproasi01(elan)[ /coface/wikis/www/mw/pywikipedia ] python version.py
Pywikipedia [http] trunk/pywikipedia (r11775, 2013/07/20, 11:39:29, n/a)
Python 2.7.6 (default, Apr 17 2014, 10:38:03)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-54)]
config-settings:
use_api = True
use_api_login = True
unicode test: ok
它表明unicde设置正确。
整个错误是:
$ python ./upload.py -noverify -keep ../converted/bcExtView_broker_53.jpg "Image uploaded by word2mediawiki (BOT)"
No handlers could be found for logger "pywiki"
Logging in to af:en as afbot via API.
Should be logged in now
Reading file ../converted/bcExtView_broker_53.jpg
The suggested description is:
Image uploaded by word2mediawiki (BOT)
Uploading image file to af:en via API....
ERROR: UnicodeDecodeError: 'ascii' codec can't decode byte 0xff in position 687: ordinal not in range(128)
WARNING: Could not open 'http://dsiwikis/afWiki/api.php'. Maybe the server or
your connection is down. Retrying in 1 minutes...
最后一行显然是一个错误,因为我可以登录...
一周以来我一直在努力解决这个错误的任何帮助将不胜感激......