Sitic closed this task as "Declined". Sitic claimed this task. Sitic added a comment.
The script now works again when omitting
sandboxPage.get(force=True, get_redirect=True)
from the example in the bug report. The original working script still gets badtoken errors after it runs for some hours.
I've just seen the badtoken error on save while working on a completely unrelated script using a ipython notebook on my laptop with a pywikibot version from 13. January 2015.. `site.logout()` and then `site.login()` or a new `site = pywikibot.Site()` didn't help, all new edits got the badtoken error always showing the same csrf-token. Only `site.tokens._tokens[u'AsuraBot'] = {}` fixed the problem.
I'm surprised that I'm the only one who seems to get these errors frequently. I'm closing this bug here, it doesn't seem like a regression bug and the main bug seems to be T61678: Implement badtoken detection and recovery https://phabricator.wikimedia.org/T61678.
TASK DETAIL https://phabricator.wikimedia.org/T89702
REPLY HANDLER ACTIONS Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: Sitic Cc: Mpaa, XZise, Aklapper, Sitic, jayvdb, pywikipedia-bugs