jenkins-bot has submitted this change and it was merged.
Change subject: Set url to None if it contains only "*" in the weblink argument
......................................................................
Set url to None if it contains only "*" in the weblink argument
When "-weblink:*" is the argument passed, "*" is passed as the euquery
url
to the MediaWiki API which raises a geubad_query: Invalid query. So, a
check is made on url in handleArg() if the argument starts with "-weblink"
and if it is a * then it is set to None. Now, the MediaWiki API will
generate every page with any URL.
Bug: T113142
Change-Id: I3a324942f6ac4a187179a6db5584361d65d71e04
---
M pywikibot/pagegenerators.py
1 file changed, 4 insertions(+), 0 deletions(-)
Approvals:
John Vandenberg: Looks good to me, but someone else must approve
Mpaa: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py
index d3a15a9..3f185d4 100644
--- a/pywikibot/pagegenerators.py
+++ b/pywikibot/pagegenerators.py
@@ -700,6 +700,10 @@
if not url:
url = pywikibot.input(
u'Pages with which weblink should be processed?')
+ # If url is * we make it None in order to search for every page
+ # with any URL.
+ if url == "*":
+ url = None
gen = LinksearchPageGenerator(url, site=self.site)
elif arg.startswith('-transcludes'):
transclusionPageTitle = arg[len('-transcludes:'):]
--
To view, visit
https://gerrit.wikimedia.org/r/261767
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I3a324942f6ac4a187179a6db5584361d65d71e04
Gerrit-PatchSet: 6
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Ani310 <anirudh.gp(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>