Page MenuHomePhabricator

redirect.py should process CircularRedirect exception silently instead of break the script
Closed, DeclinedPublic

Description

C:\pwb\core>pwb.py redirect double -moves -total:500 -always -lang:en

.Page [[Portuguese Association of Ryerson]] saved
.........Traceback (most recent call last):

File "C:\pwb\core\pwb.py", line 143, in <module>
  run_python_file(fn, argv, argvu)
File "C:\pwb\core\pwb.py", line 67, in run_python_file
  exec(compile(source, filename, "exec"), main_mod.__dict__)
File "C:\pwb\core\scripts\redirect.py", line 824, in <module>
  main()
File "C:\pwb\core\scripts\redirect.py", line 820, in main
  bot.run()
File "C:\pwb\core\scripts\redirect.py", line 732, in run
  self.fix_double_redirects()
File "C:\pwb\core\scripts\redirect.py", line 536, in fix_double_redirects
  for redir_name in self.generator.retrieve_double_redirects():
File "C:\pwb\core\scripts\redirect.py", line 307, in retrieve_double_redirects

  for redir_page in gen:
File "C:\pwb\core\scripts\redirect.py", line 367, in get_moved_pages_redirects

  redirectsOnly=True):
File "C:\pwb\core\pywikibot\page.py", line 680, in getReferences
  content=content
File "C:\pwb\core\pywikibot\site.py", line 1674, in pagereferences
  namespaces=namespaces, step=step, content=content),
File "C:\pwb\core\pywikibot\site.py", line 1622, in pagebacklinks
  if redir.getRedirectTarget() == page:
File "C:\pwb\core\pywikibot\page.py", line 1201, in getRedirectTarget
  return self.site.getredirtarget(self)
File "C:\pwb\core\pywikibot\site.py", line 1476, in getredirtarget
  raise pywikibot.CircularRedirect(redirmap[title])

pywikibot.exceptions.CircularRedirect: Talk:Green Party Korea
<class 'pywikibot.exceptions.CircularRedirect'>
CRITICAL: Waiting for 1 network thread(s) to finish. Press ctrl-c to abort

C:\pwb\core>pwb.py version

WARNING: Configuration variable 'account_global' is defined but unknown. Misspelled? WARNING: Configuration variable 'use_diskcache' is defined but unknown. Misspelled? WARNING: Configuration variable 'notify_unflagged_bot' is defined but unknown. Misspelled? Pywikibot: pywikibot-core (2c735d1, s3944, 2014/03/31, 21:29:43, ok) Release version: 2.0b1 Python: 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)] unicode test: ok

Version: core-(2.0)
Severity: normal

Details

Reference
bz63569

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:16 AM
bzimport set Reference to bz63569.
bzimport added a subscriber: Unknown Object (????).

ladsgroup@tools-login:~/core-clean$ python pwb.py redirect double -lang:fa -family:wikipedia
Retrieving special page...
.
.
.

کاربر:CFCF <<<

ERROR: Page بحث کاربر:CFCF is a circular redirect.
Skipping [[fa:کاربر:CFCF]].

ladsgroup@tools-login:~/core-clean$ python pwb.py version
Pywikibot: [https] r-pywikibot-core.git (daa07a7, g3572, 2014/07/23, 22:49:39, OUTDATED)
Release version: 2.0b1
Python: 2.7.3 (default, Feb 27 2014, 19:58:35)
[GCC 4.6.3]
unicode test: ok