Patches item #1907586, was opened at 2008-03-05 02:14 Message generated for change (Comment added) made by nicdumz You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=603140&aid=1907586...
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: None Group: None Status: Open Resolution: None Priority: 8 Private: No Submitted By: Purodha B Blissenbach (purodha) Assigned to: Nobody/Anonymous (nobody) Summary: Make edit tokens dynamic in wikipedia.py
Initial Comment: Edit tokens in wikpedia.py were effectively constants up to this patch. When a token was outdated, a new one was not obtained, and edit access to the site never functioned again until the program was restarted.
The problem is described in more detail in: https://sourceforge.net/tracker/index.php?func=detail&aid=1903113&gr...
The attached patch makes tokens a bit more dynamic, it allows loading of new ones when an edit page requires.
I have tested the code, with interwiki-py only, for about 20 hours in manually assisted mode in 3, sometimes 4, parallel sessions in verbose mode. The altered branch was executed several dozen times, no problems seen.
Nevertheless, I recommend a review. I am not knowledgeable enough to be sure that there are no sideffects. I am not a python expert, so maybe, I made it too complicated. Also, though I did run few other pywikipediabot programs which were using the altered wikipdia.py without apaprent problems, that cannot be called a valid test.
----------------------------------------------------------------------
Comment By: NicDumZ — Nicolas Dumazet (nicdumz)
Date: 2009-03-23 12:06
Message: mmm sorry to take so long to review this... (whooa one year :/ ). No excuses.
It seems that something is missing.
When entering _putpage the first time, newToken=0.
* Inside _putpage, newToken is never assigned a value. * if newToken < 0, then a recursive call is made with newToken = newToken + 1 . That's the only possible call where newToken is changed.
If I get it right, whatever the workflow is, newToken will always be 0
Correct, or is it me?
If you're still motivated to code something Purodha, please update your patch, I'll make sure to review it faster ;)
----------------------------------------------------------------------
Comment By: Purodha B Blissenbach (purodha) Date: 2008-03-08 05:17
Message: Logged In: YES user_id=46450 Originator: YES
File Added: wikipedia.py-5107-diff.txt
----------------------------------------------------------------------
You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=603140&aid=1907586...
pywikipedia-l@lists.wikimedia.org