Page MenuHomePhabricator

page_tests fails for TestPageObject.testLinks because of unknown gsw language
Closed, ResolvedPublic

Description

C:\pwb\GIT\core>py -3.13 -m pwb page_tests -v TestPageObject.testLinks
tests: max_retries reduced from 15 to 3
testLinks (__main__.TestPageObject.testLinks)
Test the different types of links from a page. ... ERROR
 16.208s
======================================================================
ERROR: testLinks (__main__.TestPageObject.testLinks)
Test the different types of links from a page.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\pwb\GIT\core\tests\page_tests.py", line 543, in testLinks
    for p in mainpage.langlinks():
             ~~~~~~~~~~~~~~~~~~^^
  File "C:\pwb\GIT\core\pywikibot\page\_basepage.py", line 1606, in langlinks
    self._langlinks = set(self.iterlanglinks(include_obsolete=True))
                      ~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\pwb\GIT\core\pywikibot\site\_generators.py", line 897, in pagelanglinks
    link = pywikibot.Link.langlinkUnsafe(linkdata['lang'],
                                         linkdata['*'],
                                         source=self)
  File "C:\pwb\GIT\core\pywikibot\page\_links.py", line 591, in langlinkUnsafe
    link._site = pywikibot.Site(lang, source.family.name)
                 ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\pwb\GIT\core\pywikibot\__init__.py", line 254, in Site
    _sites[key] = interface(code=code, fam=fam, user=user)
                  ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\pwb\GIT\core\pywikibot\site\_apisite.py", line 129, in __init__
    super().__init__(code, fam, user)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "C:\pwb\GIT\core\pywikibot\site\_basesite.py", line 90, in __init__
    raise UnknownSiteError(error_msg)
pywikibot.exceptions.UnknownSiteError: Language 'gsw' does not exist in family wikipedia

----------------------------------------------------------------------
Ran 1 test in 17.437s

Details

Related Changes in Gerrit:

Event Timeline

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

[pywikibot/core@master] family: fix language alias for gsw -> als

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

Change #1168624 merged by jenkins-bot:

[pywikibot/core@master] family: fix language alias for gsw -> als

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