Hello all!
When looking http://toolserver.org/~drtrigon/DrTrigonBot/20110820.log at the very end you will see:
2011/08/21 00:08:09:: Sending mail "Bot ERROR" to "DrTrigon" as notification! 2011/08/21 00:08:09:: !!! Allowed to send email: False 2011/08/21 00:08:09:: !!! Permissions: [['user', 'bot', 'autoconfirmed', 'read', 'createaccount', 'edit', 'upload', 'createpage', 'createtalk', 'move', 'upload', 'apihighlimits'], None] 2011/08/21 00:08:09:: Getting a token. 2011/08/21 00:08:09:: !!! Try getting new token: u'4ac3be5a7d488cbd4f36f5b9c3cd522d+\' 2011/08/21 00:08:09:: Email sent.
this means, the hint given:
For your problem: try calling Site.getToken(getagain=True) when you get the exception, and retry. (this calls self._load(force=True) and throug
finally works!
The last point is now to figure out why site.getToken sometimes is called properly and sometimes not...???
Thanks for all your help! Greetings Dr. Trigon
Am 09.08.2011 21:32, schrieb Dr. Trigon:
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
Pywikipedia-l mailing list Pywikipedia-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l