Xqt created this task.
Xqt claimed this task.
Xqt added a subscriber: Xqt.
Xqt added projects: pywikibot-core, Pywikibot-replace.py.
Herald added subscribers: pywikibot-bugs-list, Aklapper.
TASK DESCRIPTION
replace.ReplaceRobot always needs a site argument. This is due to the
ReplaceRobot's constructor in replace.py is called positional and not as
keywords argument. This leads to template.TemplateRobot resets bot.site to None
when the constructor calls the ReplaceRobot.__init__.
Samples:
```
>>> import pwb, pywikibot as py
>>> site = py.Site()
>>> from scripts.template import TemplateRobot
>>> bot = TemplateRobot(iter([]), {}, **{}) # call the bot without site
argument
WARNING: Bot.site was not set before being retrieved.
WARNING: Using the default site: wikipedia:de
# the bot._site has been set
>>> bot.site
WARNING: Bot.site was not set before being retrieved.
WARNING: Using the default site: wikipedia:de
# but it was lost immediately
```
TASK DETAIL
https://phabricator.wikimedia.org/T125046
EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: Xqt
Cc: Aklapper, pywikibot-bugs-list, Xqt, jayvdb
_______________________________________________
pywikibot-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs