Page MenuHomePhabricator

expand_text fails for empty page
Closed, ResolvedPublic


API action expandtemplates requires a value for the text param


"servedby": "mw1032",
"error": {
    "code": "notext",
    "info": "The text parameter must be set",
    "*": "See for API usage"


This causes a failure running the tests on wikia


Traceback (most recent call last):

File "./tests/", line 461, in testLinks
  iw = list(mainpage.interwiki(expand=True))
File "./pywikibot/", line 1150, in interwiki
  text = self.expand_text()
File "./pywikibot/", line 647, in wrapper
  return obj(*__args, **__kw)
File "./pywikibot/", line 499, in expand_text
File "./pywikibot/", line 992, in callee
  return fn(self, *args, **kwargs)
File "./pywikibot/", line 1958, in expand_text
  return req.submit()['expandtemplates'][key]
File "./pywikibot/data/", line 1213, in submit
  self._data = super(CachedRequest, self).submit()
File "./pywikibot/data/", line 1071, in submit
  raise APIError(code, info, **result["error"]) notext: The text parameter must be set

This happens because the Wikia homepage is an empty page|revisions&rvprop=ids|flags|content

Version: core-(2.0)
Severity: normal



Related Objects


Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:49 AM
bzimport set Reference to bz73529.
bzimport added a subscriber: Unknown Object (????).

Change 173994 had a related patch set uploaded by John Vandenberg:
Skip expandtemplates if the page content is empty

Change 173994 merged by jenkins-bot:
Skip expandtemplates if the page content is empty

For context re Wikia, they use WikiaHomePage extension, and the 'mainpage' (Wikia) page is indeed empty.|revisions

(perhaps it is worth exploring whether 'empty page' is such an anomaly that it should be an exception like NoPage or IsRedirect)

jayvdb edited subscribers, added: XZise; removed: Unknown Object (????).