Page MenuHomePhabricator

Protocol in -weblink should be handled instead of resulting in APIError
Closed, ResolvedPublic


If http.s (or other ptocol?) is present in the queried domain, user should be informed by either script or by LinksearchPageGenerator's pagegenerator that it is not excepted to be present in it.

$ python3 listpages -weblink:"http://*"
WARNING: API error badquery: Invalid query.
Traceback (most recent call last):
  File "", line 390, in <module>
    if not main():
  File "", line 385, in main
  File "", line 101, in run_python_file
  File "./scripts/", line 285, in <module>
  File "./scripts/", line 257, in main
    for i, page in enumerate(gen, start=1):
  File "pywikibot-core/pywikibot/data/", line 2823, in __iter__ = self.request.submit()
  File "pywikibot-core/pywikibot/data/", line 2091, in submit
    raise APIError(**result['error']) badquery: Invalid query.
[help: See for API usage. Subscribe to the mediawiki-api-announce mailing list at &lt;; for notice of API deprecations and breaking changes.]
CRITICAL: Exiting due to uncaught exception <class ''>

$ python3 listpages -weblink:"*"
   1 Tcfc2349
1 page(s) found

Event Timeline

Framawiki created this task.
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper. · View Herald Transcript

Change 593055 had a related patch set uploaded (by Framawiki; owner: Framawiki):
[pywikibot/core@master] [FEAT] pagegenerators: handle protocols in -weblink

Change 593055 merged by jenkins-bot:
[pywikibot/core@master] [FEAT] pagegenerators: handle protocols in -weblink