jenkins-bot has submitted this change and it was merged.
Change subject: [bugfix] Ignore InvalidTitle error in Site.preloadpages ......................................................................
[bugfix] Ignore InvalidTitle error in Site.preloadpages
preloadpages should not break a script for an InvalidTitleError. Print an error message and skip that page.
Bug: T126930 Change-Id: Ie61e10719aa7c32d84fb6c252dd9c34f35c088cf --- M pywikibot/site.py 1 file changed, 5 insertions(+), 2 deletions(-)
Approvals: Mpaa: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/site.py b/pywikibot/site.py index b04cfc2..27f45fc 100644 --- a/pywikibot/site.py +++ b/pywikibot/site.py @@ -3209,8 +3209,11 @@ cache = {} # In case of duplicates, return the first entry. for priority, page in enumerate(sublist): - cache.setdefault(page.title(withSection=False), - (priority, page)) + try: + cache.setdefault(page.title(withSection=False), + (priority, page)) + except pywikibot.InvalidTitle: + pywikibot.exception()
prio_queue = [] next_prio = 0
pywikibot-commits@lists.wikimedia.org