Page MenuHomePhabricator

The script "replace" terminated due to a redirect created shortly before the script started to execute
Closed, DeclinedPublic

Description

Use of wikidataquery in pywikibots replac failed due to a newly created redirect. Actual offending change is this one. Not sure if the script was started before or after the change, but I think it was shortly after.

Command line was
$ python pwb.py replace -ns:0 -pt:1 -wikidataquery:"link[nowiki] and (claim[536] or claim[597] or claim[599] or claim[858] or claim[861] or claim[1146] or claim[1238] or claim[1285] or claim[1409] or claim[1447] or claim[1469] or claim[1541] or claim[1664] or claim[1825] or claim[1826] or claim[1967] or claim[2020] or claim[2090] or claim[2091] or claim[2162] or claim[2193] or claim[2195] or claim[2276] or claim[2350] or claim[2369])" -summary:"Legger til 'sportslenker' under brødteksten" -regex -excepttext:"\n(==+)\ *[eE]ksterne\ +lenker\s*\1\ *\n" "(\n((\{[^\n]+|\ *)\n)+(\[\[Kategori|Category):)" "\n== Eksterne lenker ==\n* {{Sportslenker}}\1"

Traceback (most recent call last):

File "pwb.py", line 248, in <module>
  if not main():
File "pwb.py", line 242, in main
  run_python_file(filename, [filename] + args, argvu, file_package)
File "pwb.py", line 120, in run_python_file
  main_mod.__dict__)
File "./scripts/replace.py", line 1124, in <module>
  main()
File "./scripts/replace.py", line 1115, in main
  bot.run()
File "./scripts/replace.py", line 681, in run
  for page in self.generator:
File "/home/john/pywikipedia/core/pywikibot/pagegenerators.py", line 1674, in PreloadingGenerator
  for page in generator:
File "/home/john/pywikipedia/core/pywikibot/pagegenerators.py", line 1269, in NamespaceFilterPageGenerator
  for page in generator:
File "/home/john/pywikipedia/core/pywikibot/pagegenerators.py", line 2469, in WikidataQueryPageGenerator
  link = page.getSitelink(site)
File "/home/john/pywikipedia/core/pywikibot/page.py", line 3822, in getSitelink
  self.get(force=force)
File "/home/john/pywikipedia/core/pywikibot/page.py", line 3749, in get
  raise pywikibot.IsRedirectPage(self)

pywikibot.exceptions.IsRedirectPage: Page [[wikidata:Q18817339]] is a redirect page.
<class 'pywikibot.exceptions.IsRedirectPage'>
CRITICAL: Closing network session.

Event Timeline

jeblad created this task.Dec 22 2015, 3:26 AM
jeblad raised the priority of this task from to Needs Triage.
jeblad updated the task description. (Show Details)
jeblad added a subscriber: jeblad.
Restricted Application added a project: Discovery. · View Herald TranscriptDec 22 2015, 3:26 AM
Restricted Application added subscribers: pywikibot-bugs-list, StudiesWorld, Aklapper. · View Herald Transcript
Multichill closed this task as Declined.Dec 29 2016, 6:35 PM
Multichill added a subscriber: Multichill.

WDQ is going to be shut down.