Page MenuHomePhabricator

template.py fails with error 'sleep' is not a valid option for TemplateRobot
Closed, ResolvedPublicBUG REPORT

Description

C:\pwb\GIT\core>pwb template -remove "Navigationsleiste Kader des VfB Lübeck"
Retrieving 6 pages from wikipedia:de.

0 pages read
0 pages written
0 pages skipped
Execution time: 0 seconds
Script terminated by exception:

ERROR: Error: 'sleep' is not a valid option for TemplateRobot.
Traceback (most recent call last):
  File "C:\pwb\GIT\core\pwb.py", line 399, in <module>
    if not main():
  File "C:\pwb\GIT\core\pwb.py", line 391, in main
    run_python_file(filename,
  File "C:\pwb\GIT\core\pwb.py", line 106, in run_python_file
    exec(compile(source, filename, 'exec', dont_inherit=True),
  File ".\scripts\template.py", line 319, in <module>
    main()
  File ".\scripts\template.py", line 315, in main
    bot.run()
  File "C:\pwb\GIT\core\pywikibot\bot.py", line 1532, in run
    self.treat(page)
  File "C:\pwb\GIT\core\scripts\replace.py", line 681, in treat
    new_text = self.apply_replacements(last_text, applied,
  File "C:\pwb\GIT\core\scripts\replace.py", line 589, in apply_replacements
    if self.opt.sleep:
  File "C:\pwb\GIT\core\pywikibot\bot.py", line 1061, in __getattr__
    return self.__getitem__(name)
  File "C:\pwb\GIT\core\pywikibot\bot.py", line 1056, in __missing__
    raise Error("'{}' is not a valid option for {}."
pywikibot.exceptions.Error: 'sleep' is not a valid option for TemplateRobot.
CRITICAL: Exiting due to uncaught exception <class 'pywikibot.exceptions.Error'>

Introduced with rPWBCdf8c2716039

Event Timeline

Xqt triaged this task as High priority.Jun 22 2021, 2:29 PM
Xqt changed the subtype of this task from "Task" to "Bug Report".Jun 22 2021, 2:32 PM

Change 700967 had a related patch set uploaded (by Matěj Suchánek; author: Matěj Suchánek):

[pywikibot/core@master] [bugfix] Inherit update_options in bot subclasses

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

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

[pywikibot/core@master] [bugfix] Don't use update_options if a bot is to be subclassed

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

Change 700931 merged by jenkins-bot:

[pywikibot/core@master] [bugfix] Don't use update_options if a bot is to be subclassed

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

Change 700967 abandoned by Matěj Suchánek:

[pywikibot/core@master] [bugfix] Inherit update_options in bot subclasses

Reason:

The other patch was merged

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

Xqt claimed this task.