Page MenuHomePhabricator

pagefromfile.py script: Problem of "-force" argument and user_confirm()
Closed, ResolvedPublicBUG REPORT

Description

What happens?:
My bot using the pagefromfile.py script has stopped working. The script asks for manual confirmation of page rewriting, which cannot be done because it works autonomously.

Here's a command and a confirmation request. I hid a redundant ones with ellipsis, added the "-simulate" option.

pwb.py pagefromfile -file:wikisections.txt -begin:{{-start-}} -end:{{-end-}} -notitle "-summary:обновление списка" -family:wikipedia -lang:ru -user:TextworkerBot -force -simulate

Reading '.../wikisections.txt'...
Page ... already exists, ***overwriting!
Edit summary: ...
Do you want to accept these changes? ([y]es, [N]o, [a]ll, [q]uit):

What should have happened instead?:
Previously, I just used the -force option.
As far as I studied the code, confirmation requests are creating in user_confirm() at bot.py:1328. This is disabled only if the -always option is present.
But pagefromfile.py does not handle the -always option in any way, so bot.py doesn't receive it. And it is not mentioned in the script help.

So, the bot cannot work autonomously.

Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc:
Pwb 6.6.1

Event Timeline

JJMC89 changed the task status from Open to In Progress.Sep 25 2021, 10:13 PM
JJMC89 claimed this task.
JJMC89 triaged this task as Medium priority.
JJMC89 subscribed.

This is a regression from {df8c2716039dc54923e5ebafa1ac816cebc38cfe}.

Change 723712 had a related patch set uploaded (by JJMC89; author: JJMC89):

[pywikibot/core@master] [fix] pagefromfile: restore always=True as default

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

Change 723712 merged by jenkins-bot:

[pywikibot/core@master] [fix] pagefromfile: don't ask for confirmation by default

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

JJMC89 removed a project: Patch-For-Review.