jayvdb created this task. jayvdb added a subscriber: jayvdb. jayvdb added a project: pywikibot-core. Restricted Application added subscribers: Aklapper, pywikipedia-bugs.
TASK DESCRIPTION Calling the `help` module on older generators results in a pywikibot `APIError` exception.
http://wiki.linuxgaming.de/api.php?action=help&modules=help&format=j... (MW 1.14)
``` {"error":{"code":"help","info":"","*":"\n \n \n ******************************************************************\n ** **\n ** This is an auto-generated MediaWiki API documentation page **\n ** ...."}} ```
```
s = pywikibot.Site('de', 'lgde') r = pywikibot.data.api.Request(site=s, action='help', modules='help') r.submit()
Found 1 lgde:de processes running, including this one. API Error: query= {'action': [u'help'], 'format': ['json'], 'maxlag': ['5'], 'modules': [u'help']} response=.... '}} Traceback (most recent call last): File "<console>", line 1, in <module> File "pywikibot/data/api.py", line 1361, in submit raise APIError(code, info, **result["error"]) APIError: help: ```
Note that the `modules` param for module `help` doesnt work in MW 1.14
TASK DETAIL https://phabricator.wikimedia.org/T93192
REPLY HANDLER ACTIONS Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: jayvdb Cc: pywikipedia-bugs, jayvdb, Aklapper
XZise added a subscriber: XZise. XZise added a comment.
See also https://phabricator.wikimedia.org/T93188 and my question also applies to this one. In fact the APIError seems reasonable, because action=help doesn't exist pre 1.25 as http://wiki.linuxgaming.de/api.php?action=help&modules=foo&format=js... returns exactly the same message. So by that standard it should throw the exception in post 1.25 (wrt https://phabricator.wikimedia.org/T93188).
TASK DETAIL https://phabricator.wikimedia.org/T93192
REPLY HANDLER ACTIONS Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: XZise Cc: XZise, jayvdb, Aklapper, pywikipedia-bugs
jayvdb added a comment.
action=help is a valid module since .. well a very long time ago. https://www.mediawiki.org/wiki/API:Help It does work as expected in 1.19 (wikia) and 1.24 (https://docs.moodle.org/19/fr/api.php)
s = pywikibot.Site('wikia', 'wikia') r = pywikibot.data.api.Request(site=s, action='help', modules='help') r.submit()
{u'help': [u'* action=help *\n Display this help screen. Or the help screen for the specified module\nParameters:\n modules - List of module names (value of the action= parameter)\n querymodules - List of query module names (value of prop=, meta= or list= parameter)\nExamples:\n Whole help page:\n api.php?action=help\n Module (action) help page:\n api.php?action=help&modules=protect\n Query (list) modules help page:\n api.php?action=help&querymodules=categorymembers\n Query (prop) modules help page:\n api.php?action=help&querymodules=info\n Query (meta) modules help page:\n api.php?action=help&querymodules=siteinfo\nHelp pages:\n https://www.mediawiki.org/wiki/API:Main_page%5Cn https://www.mediawiki.org/wiki/API:FAQ%5Cn https://www.mediawiki.org/wiki/API:Quick_start_guide%5Cn%27%5D%7D
import pywikibot s = pywikibot.Site('fr', 'moodle') r = pywikibot.data.api.Request(site=s, action='help', modules='help') r.submit()
{u'help': [u"* action=help *\n Display this help screen. Or the help screen for the specified module.\n https://www.mediawiki.org/wiki/API:Main_page%5Cn https://www.mediawiki.org/wiki/API:FAQ%5Cn https://www.mediawiki.org/wiki/API:Quick_start_guide%5CnParameters:%5Cn modules - List of module names (value of the action= parameter). Can specify submodules with a '+'\n Separate values with '|'\n Maximum number of values 50 (500 for bots)\n querymodules - DEPRECATED! Use modules=query+value instead. List of query module names (value of prop=, meta= or list= parameter)\n Separate values with '|'\n Maximum number of values 50 (500 for bots)\nExamples:\n Whole help page:\n api.php?action=help\n Module (action) help page:\n api.php?action=help&modules=protect\n Help for the query/categorymembers module:\n api.php?action=help&modules=query+categorymembers\n Help for the login and query/info modules:\n api.php?action=help&modules=login|query+info\n"]}
TASK DETAIL https://phabricator.wikimedia.org/T93192
REPLY HANDLER ACTIONS Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: jayvdb Cc: XZise, jayvdb, Aklapper, pywikipedia-bugs
XZise added a comment.
Oh interesting. But that is then a bug of the MW and not pywikibot.
TASK DETAIL https://phabricator.wikimedia.org/T93192
REPLY HANDLER ACTIONS Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: XZise Cc: XZise, jayvdb, Aklapper, pywikipedia-bugs
jayvdb added a comment.
yea, but we need to handle it, as it exists in at least 1.11 and 1.14. And those releases are not maintained, so the bug will never be fixed. Anyway, I have a fix for this and https://phabricator.wikimedia.org/T93188 coming.
TASK DETAIL https://phabricator.wikimedia.org/T93192
REPLY HANDLER ACTIONS Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: jayvdb Cc: XZise, jayvdb, Aklapper, pywikipedia-bugs
gerritbot added a subscriber: gerritbot. gerritbot added a comment.
Change 197903 had a related patch set uploaded (by John Vandenberg): API help support complete help
https://gerrit.wikimedia.org/r/197903
TASK DETAIL https://phabricator.wikimedia.org/T93192
REPLY HANDLER ACTIONS Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: gerritbot Cc: gerritbot, XZise, jayvdb, Aklapper, pywikipedia-bugs
gerritbot added a project: Patch-For-Review.
TASK DETAIL https://phabricator.wikimedia.org/T93192
REPLY HANDLER ACTIONS Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: gerritbot Cc: gerritbot, XZise, jayvdb, Aklapper, pywikipedia-bugs
gerritbot added a comment.
Change 197903 merged by jenkins-bot: API help support complete help
https://gerrit.wikimedia.org/r/197903
TASK DETAIL https://phabricator.wikimedia.org/T93192
REPLY HANDLER ACTIONS Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: gerritbot Cc: gerritbot, XZise, jayvdb, Aklapper, pywikipedia-bugs
jayvdb closed this task as "Resolved". jayvdb claimed this task.
TASK DETAIL https://phabricator.wikimedia.org/T93192
REPLY HANDLER ACTIONS Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: jayvdb Cc: gerritbot, XZise, jayvdb, Aklapper, pywikipedia-bugs
pywikipedia-bugs@lists.wikimedia.org