John Vandenberg has uploaded a new change for review.
https://gerrit.wikimedia.org/r/197903
Change subject: API help support complete help
......................................................................
API help support complete help
By default the help module pre 1.25 returns an error result with
the complete API information. As this was requested, avoid
APIError by returning a normal help response like 1.17+ help
module uses when its modules param is used.
Bug: T93192
Change-Id: Ie1e6e9c69d7b71229926fed65a7b38331f11ceac
---
M pywikibot/data/api.py
1 file changed, 6 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core
refs/changes/03/197903/1
diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py
index 741a75b..056d6c2 100644
--- a/pywikibot/data/api.py
+++ b/pywikibot/data/api.py
@@ -1296,6 +1296,12 @@
u"Pausing due to database lag: " + info)
self.site.throttle.lag(int(lag.group("lag")))
continue
+ elif code == 'help' and self.action == 'help':
+ # The help module returns an error result with the complete
+ # API information. As this was requested, avoid APIError by
+ # returning a normal help response like 1.17+ help module uses
+ # when its modules param is used.
+ return {'help': [result['error']['help']]}
if code.startswith(u'internal_api_error_'):
class_name = code[len(u'internal_api_error_'):]
--
To view, visit https://gerrit.wikimedia.org/r/197903
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie1e6e9c69d7b71229926fed65a7b38331f11ceac
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits