Page MenuHomePhabricator

TestPageObject.testLinks method of page_tests fails for wowwiki
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

pwb -site:wowwiki:en page_tests -v TestPageObject.testLinks

What happens?:

D:\pwb\GIT\core>pwb -site:wowwiki:en page_tests -v TestPageObject.testLinks
tests: max_retries reduced from 15 to 1
testLinks (__main__.TestPageObject.testLinks)
Test the different types of links from a page. ... 1
2
ERROR
 17.205s
======================================================================
ERROR: testLinks (__main__.TestPageObject.testLinks)
Test the different types of links from a page.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\pwb\GIT\core\tests\page_tests.py", line 517, in testLinks
    for p in mainpage.linkedPages():
  File "<frozen _collections_abc>", line 330, in __next__
  File "D:\pwb\GIT\core\pywikibot\tools\collections.py", line 275, in send
    return next(self._started_gen)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\pwb\GIT\core\pywikibot\data\api\_generators.py", line 610, in generator
    self.data = self.request.submit()
                ^^^^^^^^^^^^^^^^^^^^^
  File "D:\pwb\GIT\core\pywikibot\data\api\_requests.py", line 1257, in submit
    self._data = super().submit()
                 ^^^^^^^^^^^^^^^^
  File "D:\pwb\GIT\core\pywikibot\data\api\_requests.py", line 972, in submit
    result = self._json_loads(response)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\pwb\GIT\core\pywikibot\data\api\_requests.py", line 757, in _json_loads
    self.wait()
  File "D:\pwb\GIT\core\pywikibot\data\api\_requests.py", line 1103, in wait
    raise TimeoutError('Maximum retries attempted without success.')
pywikibot.exceptions.TimeoutError: Maximum retries attempted without success.

----------------------------------------------------------------------
Ran 1 test in 17.711s

FAILED (errors=1)

The reason is a failing linkesPages() method.

Using a direct call gives:

import pywikibot
site = pywikibot.Site('wowwiki:en')
maintitle = site.siteinfo['mainpage']
maintitle
'Portal:Main'
mainpage = pywikibot.Page(site, maintitle)
gen = mainpage.linkedPages()
gen
<pywikibot.data.api._generators.PageGenerator object at 0x000001AA0B3298D0>
x = list(gen)
WARNING: Non-JSON response received from server wowwiki:en for url
https://wowwiki-archive.fandom.com/api.php
The server may be down.
Status code: 200

The text message is:

MediaWiki API help | WoWWiki | Fandom


Set gpllimit = ['250']
WARNING: Waiting 5.0 seconds before retrying.
Traceback (most recent call last):
  File "<pyshell#7>", line 1, in <module>
    x = list(gen)
  File "<frozen _collections_abc>", line 330, in __next__
  File "D:\pwb\GIT\core\pywikibot\tools\collections.py", line 275, in send
    return next(self._started_gen)
  File "D:\pwb\GIT\core\pywikibot\data\api\_generators.py", line 610, in generator
    self.data = self.request.submit()
  File "D:\pwb\GIT\core\pywikibot\data\api\_requests.py", line 972, in submit
    result = self._json_loads(response)
  File "D:\pwb\GIT\core\pywikibot\data\api\_requests.py", line 757, in _json_loads
    self.wait()
  File "D:\pwb\GIT\core\pywikibot\data\api\_requests.py", line 1111, in wait
    pywikibot.sleep(delay)
  File "D:\pwb\GIT\core\pywikibot\__init__.py", line 1394, in sleep
    time_sleep(secs)
KeyboardInterrupt

Probably the family file is oudated

Event Timeline

Xqt triaged this task as High priority.Apr 17 2023, 11:01 AM

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

[pywikibot/core@master] [FIX] update wowwiki Family file

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

Change 909238 merged by jenkins-bot:

[pywikibot/core@master] [FIX] update wowwiki Family file

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

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

[pywikibot/core@master] [FIX] fix wowwiki Family file for es-wiki

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

There is an additional problem with langlinks() method. The Family file has` removed_wikis` list but FandomWiki has no interwiki_removals classproperty like WikimediaFamily which leads the obsolete property to return an empty mapping.

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

[pywikibot/core@master] [WIP] Revise Family class

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

Change 909293 merged by jenkins-bot:

[pywikibot/core@master] [FIX] fix wowwiki Family file for es-wiki

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

Change 909314 merged by jenkins-bot:

[pywikibot/core@master] [IMPR] Revise Family class

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

Xqt claimed this task.