jenkins-bot has submitted this change and it was merged.
Change subject: [FIX] Ignore invalid titles
......................................................................
[FIX] Ignore invalid titles
Previously it ignored invalid template titles like parser functions but
not when the error occured in the constructor.
Change-Id: Ibcb011848821fa2392965709771cee7737e67a95
---
M pywikibot/page.py
1 file changed, 3 insertions(+), 2 deletions(-)
Approvals:
Xqt: Looks good to me, approved
Steinsplitter: Looks good to me, but someone else must approve
jenkins-bot: Verified
diff --git a/pywikibot/page.py b/pywikibot/page.py
index f088d82..1eaf51a 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -1875,13 +1875,14 @@
# element into a list in the format used by old scripts
result = []
for template in templates:
- link = pywikibot.Link(template[0], self.site,
- defaultNamespace=10)
try:
+ link = pywikibot.Link(template[0], self.site,
+ defaultNamespace=10)
if link.canonical_title() not in titles:
continue
except pywikibot.Error:
# this is a parser function or magic word, not template name
+ # the template name might also contain invalid parts
continue
args = template[1]
intkeys = {}
--
To view, visit
https://gerrit.wikimedia.org/r/193131
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ibcb011848821fa2392965709771cee7737e67a95
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Steinsplitter <steinsplitter(a)wikipedia.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>