Page MenuHomePhabricator

site.pagebacklinks follow_redirects=True raises InterwikiRedirectPage
Closed, ResolvedPublic

Description

When a page contains a redirect to another wiki , and site.pagebacklinks is called with filterRedirects=False: InterwikiRedirectPage is raised.

Before this change, the page was causing the error.

https://travis-ci.org/jayvdb/pywikibot-core/jobs/97539420#L3534

ERROR: testLinkMethods (tests.site_tests.TestSiteGenerators)
Test site methods for getting links to and from a page.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/jayvdb/pywikibot-core/tests/site_tests.py", line 447, in testLinkMethods
    filterRedirects=False))
  File "/home/travis/build/jayvdb/pywikibot-core/pywikibot/site.py", line 3377, in pagebacklinks
    if redir.getRedirectTarget() == page:
  File "/home/travis/build/jayvdb/pywikibot-core/pywikibot/page.py", line 1491, in getRedirectTarget
    return self.site.getredirtarget(self)
  File "/home/travis/build/jayvdb/pywikibot-core/pywikibot/site.py", line 3044, in getredirtarget
    raise InterwikiRedirectPage(page, target)
InterwikiRedirectPage: Page redirects to a page on another Site.
Page: [[en:User:Gdominik100]]
Target page: [[pl:Wikipedysta:Gdominik100]] on wikipedia:pl.

Details

Event Timeline

jayvdb raised the priority of this task from to High.
jayvdb updated the task description. (Show Details)
jayvdb added a project: Pywikibot.
jayvdb subscribed.
jayvdb set Security to None.
Xqt renamed this task from site.pagebacklinks filterRedirects=False raises InterwikiRedirectPage to site.pagebacklinks follow_redirects=True raises InterwikiRedirectPage.Mar 13 2026, 8:41 PM
Xqt claimed this task.

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

[pywikibot/core@master] [bugfix] No longer try to follow interwiki redirects

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

Change #1251548 merged by jenkins-bot:

[pywikibot/core@master] [bugfix] No longer try to follow interwiki redirects

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