Bugs item #2861676, was opened at 2009-09-18 20:49 Message generated for change (Comment added) made by malafaya You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2861676...
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: interwiki Group: None Status: Open Resolution: None
Priority: 4
Private: No Submitted By: André Malafaya Baptista (malafaya) Assigned to: Nobody/Anonymous (nobody) Summary: "Edit token has failed" and crash when editing pages
Initial Comment: Pywikipedia [http] trunk/pywikipedia (r7275, 2009/09/18, 13:44:52) Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit (Intel)] ------
NOTE: Performing a recursive query first to save time.... NOTE: Nothing left to do 2 NOTE: Updating live wiki... Sleeping for 3.5 seconds, 2009-09-18 20:38:12 Updating page [[en:Category:fr:Anatomy]] via API Updating links on page [[fr:Cat,gorie:Lexique en fran╪ais de l'anatomie]]. Changes to be made: Ajoute: [[pt:Categoria:Anatomia (Franc^s)]] + [[pt:Categoria:Anatomia (Franc^s)]]
NOTE: Performing a recursive query first to save time.... NOTE: Nothing left to do 2 NOTE: Updating live wiki... Sleeping for 8.3 seconds, 2009-09-18 20:38:17 Updating page [[fr:Cat,gorie:Lexique en fran╪ais de l'anatomie]] via API Edit token has failed. Retrying. Getting a token. Sleeping for 9.1 seconds, 2009-09-18 20:38:26 Updating page [[fr:Cat,gorie:Lexique en fran╪ais de l'anatomie]] via API Edit token has failed. Giving up. Dump pt (wiktionary) saved Traceback (most recent call last): File "D:\Work\pywikipedia\interwiki.py", line 2186, in <module> bot.run() File "D:\Work\pywikipedia\interwiki.py", line 1888, in run self.queryStep() File "D:\Work\pywikipedia\interwiki.py", line 1866, in queryStep subj.finish(self) File "D:\Work\pywikipedia\interwiki.py", line 1423, in finish if self.replaceLinks(page, new, bot): File "D:\Work\pywikipedia\interwiki.py", line 1599, in replaceLinks status, reason, data = page.put(newtext, comment = mcomment) File "D:\Work\pywikipedia\wikipedia.py", line 1434, in put newPage, self.site().getToken(sysop = sysop), sysop = sysop, botflag=botflag , maxTries=maxTries) File "D:\Work\pywikipedia\wikipedia.py", line 1665, in _putPage return self._putPage(text, comment, watchArticle, minorEdit, newPage, token= self.site().getToken(sysop = sysop, getagain = True), newToken = True, sysop = s ysop) File "D:\Work\pywikipedia\wikipedia.py", line 1682, in _putPage solve = self.site().solveCaptcha(data) File "D:\Work\pywikipedia\wikipedia.py", line 4851, in solveCaptcha data = data['edit'] KeyError: 'edit'
This has been happening randomly in any wiki it updates. I forced login in all wikis before running it but it doesn't help much: it eventually runs into this exception. I use API login.
----------------------------------------------------------------------
Comment By: André Malafaya Baptista (malafaya)
Date: 2009-09-21 17:59
Message: I agree with xqt. I changed my settings to:
use_api_login = False
2 days ago and had no more problems whatsoever. I don't know if this is a Pywikipedia's (still, it should behave better) or MW API's problem.
----------------------------------------------------------------------
Comment By: xqt (xqt) Date: 2009-09-21 10:41
Message: Try
use_api_login = False
in your user_config.py
This may be only a work-around (and I haven't test it) and the bug remains. But I've found login via api isn't as stable as requested an I don't use it.
----------------------------------------------------------------------
Comment By: Mikko Silvonen (silvonen) Date: 2009-09-20 03:40
Message: The latest crash was a bit different from malafaya's example: no "Edit token has failed" message but an "Unknown Error".
... Updating links on page [[als:Amerika (Doppelkontinent)]]. Changes to be made: Ygfüegt: [[mwl:América]] + [[mwl:América]]
NOTE: Updating live wiki... Updating page [[als:Amerika (Doppelkontinent)]] via API Unknown Error. API Error code:hookaborted Information:The modification you tried to make was aborted by an extension hook Dump fi (wikipedia) saved Traceback (most recent call last): File "interwiki.py", line 2186, in <module> bot.run() File "interwiki.py", line 1888, in run self.queryStep() File "interwiki.py", line 1866, in queryStep subj.finish(self) File "interwiki.py", line 1423, in finish if self.replaceLinks(page, new, bot): File "interwiki.py", line 1599, in replaceLinks status, reason, data = page.put(newtext, comment = mcomment) File "c:\svn\pywikipedia\wikipedia.py", line 1434, in put newPage, self.site().getToken(sysop = sysop), sysop = sysop, botflag=botflag, maxTries=maxTries) File "c:\svn\pywikipedia\wikipedia.py", line 1682, in _putPage solve = self.site().solveCaptcha(data) File "c:\svn\pywikipedia\wikipedia.py", line 4851, in solveCaptcha data = data['edit'] KeyError: 'edit'
python version.py
Pywikipedia [http] trunk/pywikipedia (r7278, 2009/09/19, 13:00:22) Python 2.5.4 (r254:67916, Jan 29 2009, 12:02:11) [MSC v.1310 32 bit (Intel)]
----------------------------------------------------------------------
Comment By: Mikko Silvonen (silvonen) Date: 2009-09-20 03:31
Message: My usual "interwiki.py -autonomous -start:XXX" run is now always terminated with this error.
----------------------------------------------------------------------
Comment By: André Malafaya Baptista (malafaya) Date: 2009-09-18 20:55
Message: I don't know if it's relevant but this account is a Wikimedia global bot.
----------------------------------------------------------------------
You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2861676...
pywikipedia-bugs@lists.wikimedia.org