> Could it be it only works from one of your accounts and not from another?
What do you exactly mean? I have 1 bot account only. This one exists for
years and mailing worked fine in the past
OK. Based on the error, I suspected it was a message from the wiki. Of course, you already noted in your first mail that the message is from the framework. Silly me.
(userlib.py)
195 |
if not self.site().isAllowed('sendemail'):
|
196 |
raise UserActionRefuse('You don\'t have permission to send mail') |
isAllowed is called on the site object, in your case dewikipedia:
(wikipedia.py)
5031 |
self._load(sysop = sysop)
|
5032 |
index = self._userIndex(sysop)
|
(...) |
|
5037 |
return right in self._rights[index] |
so it might be interesting to check what yoursite._rights contains. It might be the api returns incorrect values.
so this is what I would suggest: change your code from:
def send_mailnotification(self, item):
pywikibot.output(u'Sending mail "%s" to "%s" as notification!' % (error_mail[1], error_mail[0]))
usr = userlib.User(pywikibot.getSite(), error_mail[0])
to something like:
def send_mailnotification(self, item):
pywikibot.output(u'Sending mail "%s" to "%s" as notification!' % (error_mail[1], error_mail[0]))
site = pywikibot.getSite()
pywikibot.output(u'Allowed to send email: %r' % (site.isAllowed('sendemail'),)
pywikibot.output(u'Permissions: %r' % (site._rights,)
usr = userlib.User(pywikibot.getSite(), error_mail[0])
of course, ._rights is internal and should not generally be used like this. It's a helpful debugging tool, though.
You could also run the script through pdb to do post-mortem debugging. This would allow you to check out the problem more directly.
The recent edits to the framework that could be related are:
all other recent changes are, as far as I can see, purely cosmetic.
So I would suggest: 1) see what site._rights contains, and if this does not give any useful results, 2) try to see if the problem is introduced in r9288 (see if r9287 works).
Best,
Merlijn