jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/933865 )
Change subject: [bugfix] Use 50 as default ParamInfo._limit for the first call ......................................................................
[bugfix] Use 50 as default ParamInfo._limit for the first call
ParamInfo._limit is not set for the first ParamInfo._fetch() call with frozenset({'paraminfo', 'query', 'main'}) module. Use a default of 50.
Bug: T340617 Change-Id: I640e21560aa3c655a4c5c6c4ada790d7703ab798 --- M pywikibot/data/api/_paraminfo.py 1 file changed, 16 insertions(+), 1 deletion(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/data/api/_paraminfo.py b/pywikibot/data/api/_paraminfo.py index d0a71f1..d2a9cc8 100644 --- a/pywikibot/data/api/_paraminfo.py +++ b/pywikibot/data/api/_paraminfo.py @@ -195,7 +195,9 @@ """ def module_generator(): """A generator yielding batches of modules.""" - for batch in batched(sorted(modules), self._limit): + # T340617: self._limit is not set for the first modules + # which is frozenset({'paraminfo', 'query', 'main'}) + for batch in batched(sorted(modules), self._limit or 50): for failed_module in failed_modules: yield [failed_module] failed_modules.clear()
pywikibot-commits@lists.wikimedia.org