First of all, sorry for the slow response. I haven't had time to look into this (and I still haven't). From the top of my head, the following (hoping someone else will be able to further assist):
No problem - in fact you responded 3 days later - compared to the delays I produce regularly... ;))
I *think* the list " [['user', 'bot', 'autoconfirmed','read', 'createaccount', 'edit', 'upload', 'createpage', 'createtalk','move', 'upload', 'apihighlimits'], None] " is somewhere in the bot code (wikipedia.py:5691 and further) to take as 'default' when no response (or a bogus response) is returned from the server. If not, the server might *actually* be responding with that data, in which case the server is at fault.
This sounds reasonable. I had a look into those code parts and agree with you and am also "hoping someone else will be able to further assist"... This would be great since it looks like some core code. As far as I can see 'Site.getToken' is called in most of the page class member funcs such as get, put, ... so I am confused because they all work in my code. Do you have any idea whats the initial (first) call of 'Site.getToken' in the code - the one that seams to produce the problems we encounter here...?
If it *is* the default list, I think this should be fixed. It does not make much sense to me to apply a selective default list if no response is returned -- either retry or assume we can do anything. Then again, the latter means the bot would crash when trying to lock without lock rights.
In essence: this needs some thought.
Shall I issue a bug report in tracker on sf.net?
For your problem: try calling Site.getToken(getagain=True) when you get the exception, and retry. (this calls self._load(force=True) and throug there _getUserDataOld(force=True). It's hackish, but the best I can come up with for the moment.
Hackish? You never looked at my bot code, did you? ;))
I inserted following code lines:
if not site.isAllowed('sendemail'): pywikibot.output(u'!!! Try getting new token: %r' % \ (site.getToken(getagain=True),))
So we have to wait again... ;) (may be I have to think about how to try to force such errors...)
Thanks for all your support and time!
Greetings Dr. Trigon