| Sc4s2cg added a comment. |
I added this variable to the family file, but no change in error.
def apipath(self, code):
return '/path to api.php'Also you could check the output what you get from API, what it looks like. Try to print what you actually get by Pywikibot and compare it to what you get with your script. That should help us find the issue inside Pywikibot's code if any. Maybe there is some encoding problem?
Do you mean this output? It seems like pwb is requesting json but getting html instead.
Request being made:
rawdata = http.request( site=self.site, uri=uri, method='POST', body=body,headers=headers)So rawdata is wiki.[REDACTED].com/api.php
Variables sent:
site: finalwiki:en uri: /api.php body: action="" headers: {'Content-Type': 'application/x-www-form-urlencoded', 'user-agent': 'login (finalwiki:en; User:Petike) Pywikibot/3.1.dev0 (g1) requests/2.18.4 Python/3.6.3.final.0'}I also printed out 'rawdata' from api.py by putting print(rawdata) before line 2005. It's requesting json but getting the Main_Page.html as response. The print output is here: https://pastebin.com/HYqRAiVt
TASK DETAIL
EMAIL PREFERENCES
To: Sc4s2cg
Cc: zhuyifei1999, Chicocvenancio, Framawiki, Dvorapa, Aklapper, pywikibot-bugs-list, Sc4s2cg, Magul, Tbscho, MayS, Salgo60, Mdupont, JJMC89, Avicennasis, jayvdb, Dalba, Masti, Alchimista, Rxy
Cc: zhuyifei1999, Chicocvenancio, Framawiki, Dvorapa, Aklapper, pywikibot-bugs-list, Sc4s2cg, Magul, Tbscho, MayS, Salgo60, Mdupont, JJMC89, Avicennasis, jayvdb, Dalba, Masti, Alchimista, Rxy
_______________________________________________ pywikibot-bugs mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs
