valhallasw created this task.
valhallasw added a project: Pywikibot-core.
Herald added subscribers: pywikibot-bugs-list, Aklapper.

TASK DESCRIPTION

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 = "" 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 (?!).


TASK DETAIL
https://phabricator.wikimedia.org/T143937

EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: valhallasw
Cc: Aklapper, DekelE, valhallasw, pywikibot-bugs-list, Mdupont, JJMC89, jayvdb
_______________________________________________
pywikibot-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs

Reply via email to