Last modified: 2014-11-18 03:20:01 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T75529, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 73529 - expand_text fails for empty page
expand_text fails for empty page
Status: RESOLVED FIXED
Product: Pywikibot
Classification: Unclassified
General (Other open bugs)
core-(2.0)
All All
: Unprioritized normal
: ---
Assigned To: Pywikipedia bugs
:
Depends on:
Blocks: 73513
  Show dependency treegraph
 
Reported: 2014-11-17 22:35 UTC by John Mark Vandenberg
Modified: 2014-11-18 03:20 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description John Mark Vandenberg 2014-11-17 22:35:41 UTC
API action expandtemplates requires a value for the text param

https://en.wikipedia.org/w/api.php?action=expandtemplates&text=

{
    "servedby": "mw1032",
    "error": {
        "code": "notext",
        "info": "The text parameter must be set",
        "*": "See https://en.wikipedia.org/w/api.php for API usage"
    }
}

This causes a failure running the tests on wikia

page_tests.TestPageObject.testLinks

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

This happens because the Wikia homepage is an empty page

http://www.wikia.com/Wikia?action=edit
http://www.wikia.com/api.php?format=jsonfm&action=query&titles=Wikia&prop=info|revisions&rvprop=ids|flags|content
Comment 1 Gerrit Notification Bot 2014-11-17 22:38:24 UTC
Change 173994 had a related patch set uploaded by John Vandenberg:
Skip expandtemplates if the page content is empty

https://gerrit.wikimedia.org/r/173994
Comment 2 Gerrit Notification Bot 2014-11-18 00:52:27 UTC
Change 173994 merged by jenkins-bot:
Skip expandtemplates if the page content is empty

https://gerrit.wikimedia.org/r/173994

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links