Page MenuHomePhabricator

Requests fails with AttributeError on timeouts
Closed, ResolvedPublic

Description

18:30:34 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
18:30:34 
18:30:34 self = pywikibot.data.api._requests.Request<infogalactic:infogalactic->'/w/api.php?list=logevents&action=query&indexpageids=&continue=&letype=import&lelimit=1&meta=userinfo&uiprop=blockinfo|hasmsg&maxlag=5&format=json'>
18:30:34 delay = None
18:30:34 
18:30:34     def wait(self, delay: Optional[int] = None) -> None:
18:30:34         """Determine how long to wait after a failed request.
18:30:34     
18:30:34         :param delay: Minimum time in seconds to wait. Overwrites
18:30:34             ``retry_wait`` variable if given. The delay doubles each
18:30:34             retry until ``retry_max`` seconds is reached.
18:30:34         """
18:30:34         if not hasattr(self, 'max_retries'):
18:30:34             self.max_retries = pywikibot.config.max_retries
18:30:34     
18:30:34         if not hasattr(self, 'retry_wait'):
18:30:34             self.retry_wait = pywikibot.config.retry_wait
18:30:34     
18:30:34 >       if self.current_retries > self.max_retries:
18:30:34 E       AttributeError: 'Request' object has no attribute 'current_retries'
18:30:34 
18:30:34 pywikibot/data/__init__.py:41: AttributeError

https://integration.wikimedia.org/ci/job/pywikibot-core-tox-deeptest-py39-docker/833/console

Event Timeline

Xqt changed the task status from Open to In Progress.Aug 26 2023, 11:41 AM
Xqt triaged this task as High priority.

Change 952520 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] [bugfix] Fix AttributeError on timeouts

https://gerrit.wikimedia.org/r/952520

Change 952520 merged by jenkins-bot:

[pywikibot/core@master] [bugfix] Fix AttributeError on timeouts

https://gerrit.wikimedia.org/r/952520