jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/378877 )
Change subject: Fix behavior when treat_missing_item is None ......................................................................
Fix behavior when treat_missing_item is None
When is_item is False, we should obviously try to load the page's item if it has one.
Change-Id: I510830ff85d747dd370dc9f69c62d3e0dfdfd5e3 --- M pywikibot/bot.py 1 file changed, 4 insertions(+), 1 deletion(-)
Approvals: jenkins-bot: Verified Xqt: Looks good to me, approved
diff --git a/pywikibot/bot.py b/pywikibot/bot.py index 3444389..03e22e8 100644 --- a/pywikibot/bot.py +++ b/pywikibot/bot.py @@ -2130,7 +2130,10 @@ item = pywikibot.ItemPage(data_site, page.title()) page = None else: - item = None + try: + item = pywikibot.ItemPage.fromPage(page) + except pywikibot.NoPage: + item = None if self.use_from_page is False: pywikibot.error('{0} is not in the item namespace but ' 'must be an item.'.format(page))
pywikibot-commits@lists.wikimedia.org