Test code:
import pywikibot from pywikibot.page import User from pywikibot.site import APISite site = pywikibot.Site() summary = 'בדיקת בוט' username = u'בלה' currentUser = User(site, username) data = site.unblockuser(currentUser, summary) print data
Family file:
from pywikibot import family
class Family(family.Family):
def __init__(self):
family.Family.__init__(self)
self.name = 'kidipedia'
self.langs = {
'he': 'www.kidipedia.org.il',
}
def path(self, code):
"""Return the path to index.php for this family."""
return '/index.php'
def scriptpath(self, code):
"""Return the script path for this family."""
return ''
def apipath(self, code):
"""Return the path to api.php for this family."""
return '/api.php'The wiki correctly reports the encoding (utf-8), both in the content-type and in a <meta> tag.
The data sent over the wire to the wiki is actually
urlencode(u'בלה'.encode('utf-8').decode('latin-1').encode('utf-8'))
This always happens for the user parameter; the summary is correctly sent if provided as bytes, but not when provided as unicode (?!).