https://bugzilla.wikimedia.org/show_bug.cgi?id=59678
--- Comment #2 from Merlijn van Deen valhallasw@arctus.nl --- OK, so this is slightly more complicated than it seems.
There are two obvious methods: - handle the BadToken error in data/api.py. We can just self.sleep() and then get a new edit token - handle the BadToken error in data/page.py, in editpage()
Both options have their problems.
data/api.py: good: we can also handle other types of token problems bad: edit tokens also serve to detect edit conflicts, and we cannot handle those at the data/api.py level...
data/page.py: good: the logic for getting tokens & handling edit conflicts is already here! bad: the retry logic is in the data/api.py layer, and it doesn't cover other token issues