Page MenuHomePhabricator

replace.py skips the page when "open in [b]rowser" is chosen
Closed, ResolvedPublicFeature

Description

Steps to replicate the issue (include links if applicable):

  • python pwb.py replace -page:foobar "foo" "bar"
  • Select b when the prompt asks "Do you want to accept these changes?"
  • Press Enter when finished in browser

What happens?:
The script only opens the page in browser, effectively the same as choosing "[N]o" in terms of whether it makes any changes to the page (i.e., it "skips" the page).

What should have happened instead?:
The script should re-prompt "Do you want to accept these changes?"

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):
1.43.0

Other information:

  • Pywikibot release version: 10.1.0.dev0

Event Timeline

@BryghtShadow @Xqt This can be a good first task. I can add it to the Wiki mentor Africa Hackathon board happening over the weekend.

@BryghtShadow @Xqt This can be a good first task. I can add it to the Wiki mentor Africa Hackathon board happening over the weekend.

I don't think so because it won't work.

Xqt changed the subtype of this task from "Bug Report" to "Feature Request".Mar 30 2025, 1:46 PM

@BryghtShadow: Thank you for your proposal:

What should have happened instead?:
The script should re-prompt "Do you want to accept these changes?"

This cannot be done because the change is prossibly already done. With 'b' command a browser is invoked and you can change the content with it or keep the page. There is no replacements prepared with it. I think it is not very usefull to revoke the previously changed text.

Change #1132719 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] [IMPR] After the browser call, the script affects the possibly changed text

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

Xqt triaged this task as Low priority.Mar 31 2025, 6:12 PM

@BryghtShadow: I changed my mind. Are you able to test the patch given above?

Xqt claimed this task.

Change #1132719 merged by jenkins-bot:

[pywikibot/core@master] [IMPR] After the browser call, the script affects the possibly changed text

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