jenkins-bot submitted this change.

View Change


Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
[cleanup] remove "continue" parameter from siteinfo request

Also remove site.mw_version check due to T306637.
Keep adding rawcontinue until other dependencies are solved.
Keep site.mw_version check, otherwise api_tests.TestLazyLoginNoUsername
fails.

Bug: T343204
Change-Id: I8bc3101d257630ab61bfbb436f35253065de0ab4
---
M pywikibot/site/_siteinfo.py
M pywikibot/data/api/_requests.py
2 files changed, 22 insertions(+), 9 deletions(-)

diff --git a/pywikibot/data/api/_requests.py b/pywikibot/data/api/_requests.py
index 25f7e57..ee19e54 100644
--- a/pywikibot/data/api/_requests.py
+++ b/pywikibot/data/api/_requests.py
@@ -434,11 +434,11 @@
and self.site.has_extension('ProofreadPage'):
prop = set(self['prop'] + ['proofread'])
self['prop'] = sorted(prop)
- # When neither 'continue' nor 'rawcontinue' is present and the
- # version number is at least 1.25wmf5 we add a dummy rawcontinue
- # parameter. Querying siteinfo is save as it adds 'continue'
- # except for 'tokens' (T284577)
- if ('tokens' not in meta and 'continue' not in self._params
+ # When neither 'continue' nor 'rawcontinue' is present we add a
+ # dummy rawcontinue parameter except for 'tokens' (T284577) and
+ # 'siteinfo' (T343204)
+ if ('tokens' not in meta and 'siteinfo' not in meta
+ and 'continue' not in self._params
and self.site.mw_version >= '1.25wmf5'):
self._params.setdefault('rawcontinue', [''])

diff --git a/pywikibot/site/_siteinfo.py b/pywikibot/site/_siteinfo.py
index 2863823..4aa01df 100644
--- a/pywikibot/site/_siteinfo.py
+++ b/pywikibot/site/_siteinfo.py
@@ -1,6 +1,6 @@
"""Objects representing site info data contents."""
#
-# (C) Pywikibot team, 2008-2022
+# (C) Pywikibot team, 2008-2023
#
# Distributed under the terms of the MIT license.
#
@@ -158,9 +158,7 @@
'action': 'query', 'meta': 'siteinfo', 'siprop': props,
}
)
- # With 1.25wmf5 it'll require continue or rawcontinue. As we don't
- # continue anyway we just always use continue.
- request['continue'] = True
+
# warnings are handled later
request._warning_handler = warn_handler
try:

To view, visit change 944181. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I8bc3101d257630ab61bfbb436f35253065de0ab4
Gerrit-Change-Number: 944181
Gerrit-PatchSet: 6
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged