jenkins-bot has submitted this change and it was merged.
Change subject: Clarify error and message ......................................................................
Clarify error and message
One change is to narrow down an Error into InvalidTitle, the other is to add the text itself to the message reporting regex match against it.
Change-Id: Ibf120f025047e0dde27cd9af512526f444563949 --- M pywikibot/page.py 1 file changed, 2 insertions(+), 2 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/page.py b/pywikibot/page.py index 3883961..935331b 100644 --- a/pywikibot/page.py +++ b/pywikibot/page.py @@ -3287,7 +3287,7 @@ if newsite == self._site: if not t: # Can't have an empty self-link - raise pywikibot.Error( + raise pywikibot.InvalidTitle( "Invalid link title: '%s'" % self._text) firstPass = False continue @@ -3305,7 +3305,7 @@ m = Link.illegal_titles_pattern.search(t) if m: raise pywikibot.InvalidTitle( - u"contains illegal char(s) '%s'" % m.group(0)) + u"%s contains illegal char(s) %s" % (repr(t), repr(m.group(0))))
# Pages with "/./" or "/../" appearing in the URLs will # often be unreachable due to the way web browsers deal
pywikibot-commits@lists.wikimedia.org