Page MenuHomePhabricator

interwiki.py should ignore/skip pages that redirects to another wiki instead of crashing
Open, HighPublic

Description

NOTE: [[ja:エイブラハム]] does not exist. Skipping.
Dump en (wiktionary) appended.
Traceback (most recent call last):
  File "/home/roboko/pywikibot/pwb.py", line 257, in <module>
    if not main():
  File "/home/roboko/pywikibot/pwb.py", line 251, in main
    run_python_file(filename, [filename] + args, argvu, file_package)
  File "/home/roboko/pywikibot/pwb.py", line 121, in run_python_file
    main_mod.__dict__)
  File "/home/roboko/pywikibot/scripts/interwiki.py", line 2624, in <module>
    main()
  File "/home/roboko/pywikibot/scripts/interwiki.py", line 2599, in main
    bot.run()
  File "/home/roboko/pywikibot/scripts/interwiki.py", line 2315, in run
    self.queryStep()
  File "/home/roboko/pywikibot/scripts/interwiki.py", line 2289, in queryStep
    self.oneQuery()
  File "/home/roboko/pywikibot/scripts/interwiki.py", line 2284, in oneQuery
    subject.batchLoaded(self)
  File "/home/roboko/pywikibot/scripts/interwiki.py", line 1340, in batchLoaded
    redirectTargetPage = page.getRedirectTarget()
  File "/home/roboko/pywikibot/pywikibot/page.py", line 1575, in getRedirectTarget
    return self.site.getredirtarget(self)
  File "/home/roboko/pywikibot/pywikibot/site.py", line 3064, in getredirtarget
    raise InterwikiRedirectPage(page, target)
pywikibot.exceptions.InterwikiRedirectPage: Page redirects to a page on another Site.
Page: [[ja:エウェ語]]
Target page: [[wikipedia:ja:エウェ語]] on wikipedia:ja.
<class 'pywikibot.exceptions.InterwikiRedirectPage'>
CRITICAL: Closing network session.
NOTE: [[ja:окровавленный]] does not exist. Skipping.
Dump en (wiktionary) appended.
Traceback (most recent call last):
  File "/home/roboko/pywikibot/pwb.py", line 257, in <module>
    if not main():
  File "/home/roboko/pywikibot/pwb.py", line 251, in main
    run_python_file(filename, [filename] + args, argvu, file_package)
  File "/home/roboko/pywikibot/pwb.py", line 121, in run_python_file
    main_mod.__dict__)
  File "/home/roboko/pywikibot/scripts/interwiki.py", line 2624, in <module>
    main()
  File "/home/roboko/pywikibot/scripts/interwiki.py", line 2599, in main
    bot.run()
  File "/home/roboko/pywikibot/scripts/interwiki.py", line 2315, in run
    self.queryStep()
  File "/home/roboko/pywikibot/scripts/interwiki.py", line 2289, in queryStep
    self.oneQuery()
  File "/home/roboko/pywikibot/scripts/interwiki.py", line 2284, in oneQuery
    subject.batchLoaded(self)
  File "/home/roboko/pywikibot/scripts/interwiki.py", line 1340, in batchLoaded
    redirectTargetPage = page.getRedirectTarget()
  File "/home/roboko/pywikibot/pywikibot/page.py", line 1575, in getRedirectTarget
    return self.site.getredirtarget(self)
  File "/home/roboko/pywikibot/pywikibot/site.py", line 3064, in getredirtarget
    raise InterwikiRedirectPage(page, target)
pywikibot.exceptions.InterwikiRedirectPage: Page redirects to a page on another Site.
Page: [[ja:古ノルド語]]
Target page: [[wikipedia:ja:古ノルド語]] on wikipedia:ja.
<class 'pywikibot.exceptions.InterwikiRedirectPage'>
CRITICAL: Closing network session.

Event Timeline

Restricted Application added subscribers: pywikibot-bugs-list, Zppix, Aklapper. · View Herald TranscriptJun 13 2016, 10:00 PM

Maybe a duplicate of T121833, I'm not sure.

Thibaut120094 triaged this task as High priority.Jun 14 2016, 11:48 AM
whym added a subscriber: whym.Jun 14 2016, 12:29 PM

It would help to have a concise command to reproduce the problem, not just the error message. In this case it would be something like:

python pwb.py interwiki -family:wiktionary -lang:en -page:%E5%8F%A4%E3%83%8E%E3%83%AB%E3%83%89%E8%AA%9E -simulate -hint:ja:
Thibaut120094 added a comment.EditedJun 14 2016, 12:37 PM

It would help to have a concise command to reproduce the problem, not just the error message. In this case it would be something like:

python pwb.py interwiki -family:wiktionary -lang:en -page:%E5%8F%A4%E3%83%8E%E3%83%AB%E3%83%89%E8%AA%9E -simulate -hint:ja:

Hi, you can reproduce the bug with this command:

python pwb.py interwiki -family:wiktionary -lang:en -wiktionary エウェ語

it also crashes with the -noredirect and -autonomous options:

python pwb.py interwiki -family:wiktionary -lang:en -wiktionary -autonomous -noredirect エウェ語