jenkins-bot submitted this change.

View Change

Approvals: jenkins-bot: Verified Xqt: Looks good to me, approved
Revert "[IMPR] use CachedRequest for userinfo requests"

This reverts commit 07adfba14c901e46a4c794c3b4f5ad673a7f7885.

Bug: T348925
Bug: T365942
Change-Id: Ie8e34ff2678d5f548b05b796895dc3264689f45b
---
M ROADMAP.rst
M pywikibot/config.py
M pywikibot/site/_apisite.py
3 files changed, 5 insertions(+), 15 deletions(-)

diff --git a/ROADMAP.rst b/ROADMAP.rst
index e42e037..30a077d 100644
--- a/ROADMAP.rst
+++ b/ROADMAP.rst
@@ -1,7 +1,6 @@
Current release
---------------

-* Use :class:`data.api.CachedRequest` for userinfo requests (:phab:`T348925`)
* Raise :exc:`exceptions.SectionError` if a section does not exists on a page (:phab:`T107141`)
* Retry api request on ServerError (:phab:`T364275`, :phab:`T364393`)

diff --git a/pywikibot/config.py b/pywikibot/config.py
index b2f20fb..7f12bcc 100644
--- a/pywikibot/config.py
+++ b/pywikibot/config.py
@@ -175,8 +175,6 @@
site_interface = 'APISite'
# number of days to cache namespaces, api configuration, etc.
API_config_expiry = 30
-# userinfo expiry
-API_uinfo_expiry = 1

# The maximum number of bytes which uses a GET request, if not positive
# it'll always use POST requests
diff --git a/pywikibot/site/_apisite.py b/pywikibot/site/_apisite.py
index 0fe76de..729a7ec 100644
--- a/pywikibot/site/_apisite.py
+++ b/pywikibot/site/_apisite.py
@@ -648,10 +648,6 @@
.. seealso:: :api:`Userinfo`
.. versionchanged:: 8.0
Use API formatversion 2.
- .. versionchanged:: 9.2
- API call is made through :class:`data.api.CachedRequest` with
- expiry is set in ``API_uinfo_expiry`` within
- :ref:`Account settings`.

:return: A dict with the following keys and values:

@@ -665,14 +661,11 @@

"""
if not hasattr(self, '_userinfo'):
- uirequest = self._request(
- expiry=pywikibot.config.API_uinfo_expiry,
- parameters={
- 'action': 'query',
- 'meta': 'userinfo',
- 'uiprop': 'blockinfo|hasmsg|groups|rights|ratelimits',
- 'formatversion': 2,
- }
+ uirequest = self.simple_request(
+ action='query',
+ meta='userinfo',
+ uiprop='blockinfo|hasmsg|groups|rights|ratelimits',
+ formatversion=2,
)
uidata = uirequest.submit()
assert 'query' in uidata, \

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

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