{6e1f391837ea6} broke support for MediaWiki 1.14
$ python pwb.py shell Welcome to the Pywikibot interactive shell! >>> s = pywikibot.Site('ar', 'anarchopedia') >>> p = pywikibot.Page(s, 'main page') >>> p.text ERROR: AssertionError: Traceback (most recent call last): ... File ".../pywikibot/page.py", line 500, in text self._text = self.get(get_redirect=True) File ".../pywikibot/tools/__init__.py", line 1327, in wrapper return obj(*__args, **__kw) File ".../pywikibot/page.py", line 367, in get self._getInternals(sysop) File ".../pywikibot/page.py", line 397, in _getInternals self.site.loadrevisions(self, getText=True, sysop=sysop) File ".../pywikibot/site.py", line 3713, in loadrevisions step=step, total=total, **rvargs) File ".../pywikibot/site.py", line 1867, in _generator gen = gen_class(type_arg, **req_args) File ".../pywikibot/data/api.py", line 2909, in __init__ QueryGenerator.__init__(self, **kwargs) File ".../pywikibot/data/api.py", line 2504, in __init__ self.site._paraminfo.fetch('query+' + mod for mod in self.modules) File ".../pywikibot/data/api.py", line 563, in fetch self._init() File ".../pywikibot/data/api.py", line 275, in _init assert self._action_modules == set(main_modules_param['type']) AssertionError
The fix is:
diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py index c932613..84c1232 100644 --- a/pywikibot/data/api.py +++ b/pywikibot/data/api.py @@ -371,6 +371,8 @@ class ParamInfo(Container): ], } + self._add_submodules('main', action_modules) + if _mw_ver >= MediaWikiVersion('1.12'): return