Page MenuHomePhabricator

fixing_redirects.py: use textlib.replace_links() instead of FixingRedirectBot.replace_links()
Open, HighPublic

Description

def treat should be moved to pywikibot/textlib.py (as 'replaceLinks(text, fromPage, toPage)')


Version: core-(2.0)
Severity: normal

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 2:20 AM
bzimport set Reference to bz59686.

Change 137802 had a related patch set uploaded by Ricordisamoa:
move treat() out of fixing_redirects.py, as generic textlib.replaceLinks()

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

Change 137802 had a related patch set uploaded (by XZise):
New textlib.replace_links() link replacements

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

Change 137802 had a related patch set uploaded (by XZise):

Reassigning accordingly.

I don't know why gerritbot commented again but as you can see the same patch (which is still authored by you) was reported by @gerritbot a year ago.

I cannot commit (pun intended) to that patch anymore. Feel free to place it back up for grabs.

Change 137802 merged by jenkins-bot:
New textlib.replace_links() link replacements

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

Xqt reopened this task as Open.EditedAug 24 2016, 3:53 PM
Xqt subscribed.

reopened due to the revert with 8a7c42f50ac1c99b99d7cac9c because of the regression made by 18e6c9b1e655a807ce0ab732880c9874093cef1b

Xqt triaged this task as High priority.Oct 30 2016, 11:44 AM
Xqt removed XZise as the assignee of this task.May 26 2017, 5:42 AM
Xqt added a subscriber: XZise.

Change 491673 had a related patch set uploaded (by Dvorapa; owner: Dvorapa):
[pywikibot/core@master] [IMPR] Fix weirdly broken replace_links to behave more expectable

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

Change 491884 had a related patch set uploaded (by Dvorapa; owner: Dvorapa):
[pywikibot/core@master] [bugfix] Fix the behavior of fixing_redirects.py

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

Change 491884 had a related patch set uploaded (by Dvorapa; owner: Dvorapa):
[pywikibot/core@master] [bugfix] Fix the behavior of fixing_redirects.py

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

Change #491673 abandoned by JJMC89:

[pywikibot/core@master] [IMPR] Fix weirdly broken replace_links to behave more expectable

Reason:

stale patch that cannot be merged - feel free to unabandon if you will update it

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

Change #491884 abandoned by JJMC89:

[pywikibot/core@master] [bugfix] Fix the behavior of fixing_redirects.py

Reason:

stale patch that cannot be merged - feel free to unabandon if you will update it

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

RaushanCode subscribed.

Would like to work on this and will push a fresh patch shortly

Change #1282976 had a related patch set uploaded (by Raushan 31; author: Raushan 31):

[pywikibot/core@master] [IMPR] Move redirect replacement logic to textlib.replaceLinks

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

treat() was already replaced in rPWBC18e6c9b but reverted in rPWBC8a7c42f due to an insufficient implementation of textlib.replace_links() and breaking changes (see comments above). The
fixing_redirects.FixingRedirectBot.replace_links() method should be replaces by the textlib.replace_links() function after the implementation has been fixed or improved.

Xqt renamed this task from fixing_redirects.py: move treat() to pywikibot/textlib to fixing_redirects.py: use textlib.replace_links() instead of FixingRedirectBot.replace_links().May 6 2026, 9:31 AM

Change #1282976 abandoned by Xqt:

[pywikibot/core@master] [IMPR] Move redirect replacement logic to textlib.replaceLinks

Reason:

Duplicate implemetation of replace_links

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