jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1036734?usp=email )
Change subject: [cleanup] deactivate wait cycle for Page.main_authors() ......................................................................
[cleanup] deactivate wait cycle for Page.main_authors()
Bug: T366100 Change-Id: I3bf4e6e28ebd4b75f53469754be1d3329b026e4f --- M pywikibot/page/_toolforge.py 1 file changed, 11 insertions(+), 9 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/page/_toolforge.py b/pywikibot/page/_toolforge.py index 37df61b..ebdf5b2 100644 --- a/pywikibot/page/_toolforge.py +++ b/pywikibot/page/_toolforge.py @@ -3,7 +3,7 @@ .. versionadded:: 7.7 """ # -# (C) Pywikibot team, 2022-2023 +# (C) Pywikibot team, 2022-2024 # # Distributed under the terms of the MIT license. # @@ -62,19 +62,20 @@
.. note:: Only implemented for main namespace pages. .. note:: Only wikipedias of :attr:`WIKIBLAME_CODES` are supported. + .. attention:: This method does not return new results due to + :phab:`366100`. .. seealso:: - https://wikihistory.toolforge.org - https://de.wikipedia.org/wiki/Wikipedia:Technik/Cloud/wikihistory
- :param onlynew: If False, use the cached values. If True, - calculate the Counter data which can take some time; it may - fail with TimeoutError after ``config.max_retries``. If None - it calculates new data like for True but uses data from - cache if new data cannot be calculated in meantime. + .. versionchanged:: 9.2 + do not use any wait cycles due to :phab:`366100`. + + :param onlynew: Currently meaningless :return: Number of edits for each username :raise NotImplementedError: unsupported site or unsupported namespace :raise pywikibot.exceptions.NoPageError: The page does not exist - :raise pywikibot.exceptions.TimeoutError: Maximum retries exceeded + :raise pywikibot.exceptions.TimeoutError: No cached results found """ baseurl = 'https://wikihistory.toolforge.org' pattern = (r'><bdi>(?P<author>.+?)</bdi></a>\s' @@ -97,10 +98,11 @@ {user: int(cnt) for user, cnt in re.findall(pattern, r.text)})
+ break # T366100 + delay = pywikibot.config.retry_wait * 2 ** current_retries pywikibot.warning('WikiHistory timeout.\n' - 'Waiting {:.1f} seconds before retrying.' - .format(delay)) + f'Waiting {delay:.1f} seconds before retrying.') pywikibot.sleep(delay) if onlynew is None and current_retries >= config.max_retries - 2: url += '&onlynew=1'
pywikibot-commits@lists.wikimedia.org