Page MenuHomePhabricator

Cannot delete more than one page with delete.py
Closed, ResolvedPublic

Description

delete.py with botpasswords seemed to be the only way to get around the OAuth issue with this script. I've been using this for some time until today where it broke. I cannot delete more than one page without pywikibot asking me for the password every time (pages to be deleted suplied with the -file:todelete.txt option).

>>> MediaWiki:AllmessagesnotsupportedDB <<<
Do you want to delete [[bs:MediaWiki:AllmessagesnotsupportedDB]]? ([y]es, [N]o, [a]ll, [q]uit): y
Logging in to wikibooks:bs as MarcoAurelio@bot


>>> MediaWiki:AllmessagesnotsupportedUI <<<
Do you want to delete [[bs:MediaWiki:AllmessagesnotsupportedUI]]? ([y]es, [N]o, [a]ll, [q]uit): y
Logging in to wikibooks:bs as MarcoAurelio@bot
ERROR: Login failed (Aborted).
Password for user MarcoAurelio@bot on wikibooks:bs (no characters will be shown):

##Degug##
{"login":{"result":"Aborted","reason":"Cannot log in when using MediaWiki\\Session\\BotPasswordSessionProvider sessions."}}

Event Timeline

Restricted Application added subscribers: pywikibot-bugs-list, Aklapper. · View Herald TranscriptMar 7 2018, 3:21 PM
Dalba added a subscriber: Dalba.Mar 16 2018, 3:22 AM

Using BotPassword on https://fa.wikipedia.beta.wmflabs.org/ I could not reproduce this issue:

$ python pwb.py delete -family:wpbeta -lang:fa -file:todelete.txt
Enter a reason for the deletion: myreason


>>> I <<<
Do you want to delete [[fa:I]]? ([y]es, [N]o, [a]ll, [q]uit): y

Logging in to wpbeta:fa as Dalba@Dalba


>>> J <<<
Do you want to delete [[fa:J]]? ([y]es, [N]o, [a]ll, [q]uit): y

2 pages read
0 pages written
Execution time: 14 seconds
Read operation time: 7 seconds
Script terminated successfully.

The error message that you're receiving is similar to the one in T154324. If you were logged in through another session with the same account then perhaps this task should be closed as a duplicate of that.

Dalba reopened this task as Open.Sun, Aug 25, 3:16 AM

According to T154324#4164161 this should also be resolvable in pywikibot itself and I think https://gerrit.wikimedia.org/r/c/pywikibot/core/+/531589 will do it.

Restricted Application added a subscriber: Liuxinyu970226. · View Herald TranscriptSun, Aug 25, 3:16 AM
Huji added a subscriber: Huji.Sun, Aug 25, 1:06 PM

@MarcoAurelio it would be nice if you could test and confirm that my patch (r531589) can fix this issue

Change 531589 had a related patch set uploaded (by Huji; owner: Huji):
[pywikibot/core@master] Check a user's rights before checking its group memberships

https://gerrit.wikimedia.org/r/531589

Change 531589 merged by jenkins-bot:
[pywikibot/core@master] Check a user's rights before checking its group memberships

https://gerrit.wikimedia.org/r/531589

Huji closed this task as Resolved.Mon, Aug 26, 5:21 PM
Huji claimed this task.

I am assuming r531589 fixed this. Reopen if otherwise.