I guess this was introduced in r5037 (Reorganization of the user data retrieving: moving it to a single function.) with _getUserData() renamed to _getUserDataOld() now but I don't see the point for "Assume the user has the default rights". Maybe this is good enough for screen-scrapped pages.
Greetings xqt
----- Original Nachricht ---- Von: Merlijn van Deen valhallasw@arctus.nl An: Pywikipedia discussion list pywikipedia-l@lists.wikimedia.org Datum: 09.08.2011 17:04 Betreff: Re: [Pywikipedia-l] No permission to send mail...
Hello,
On 6 August 2011 18:55, Dr. Trigon dr.trigon@surfeu.ch wrote:
2011/08/06 04:45:45:: !!! Permissions: [[u'move', u'autoreview', u'move-rootuserpages', u'createtalk', u'minoredit', u'movestable', u'skipcaptcha', u'nominornewtalk', u'noratelimit', u'*', u'collectionsaveasuserpage', u'abusefilter-view', u'abusefilter-log-detail', u'createpage', u'writeapi', u'createaccount', u'centralauth-merge', u'read', u'autopatrol', u'abusefilter-log', u'suppressredirect', u'user', u'collectionsaveascommunitypage', u'reupload-own', u'apihighlimits', u'autoconfirmed', u'edit', u'sendemail', u'bot', u'upload', u'purge', u'reupload'], None] 2011/08/06 04:45:45:: Email sent.
and here the second run:
2011/08/06 18:28:37:: !!! Permissions: [['user', 'bot', 'autoconfirmed', 'read', 'createaccount', 'edit', 'upload', 'createpage', 'createtalk', 'move', 'upload', 'apihighlimits'], None]
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): 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.
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.
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.
Best, Merlijn
Pywikipedia-l mailing list Pywikipedia-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
Arcor empfiehlt: Die TOP 1000 Surftipps zu allem, was im Internet interessant und spannend ist - sehen Sie hier: http://www.arcor.de/content/pc_technik/internet/surftipps/surftipps/