Xqt created this task.
Xqt added projects: Pywikibot, Pywikibot-tests.
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper.

TASK DESCRIPTION
    ____________________ TestSiteGenerators.test_pagelanglinks 
_____________________
    
    self = <tests.site_tests.TestSiteGenerators testMethod=test_pagelanglinks>
    
        def test_pagelanglinks(self):
            """Test Site.pagelanglinks."""
    >       for ll in self.site.pagelanglinks(self.mainpage):
    
    tests/site_tests.py:427: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
_ _ 
    pywikibot/site/_generators.py:761: in pagelanglinks
        source=self)
    pywikibot/page/__init__.py:5593: in langlinkUnsafe
        link._site = pywikibot.Site(lang, source.family.name)
    pywikibot/tools/_deprecate.py:404: in wrapper
        return obj(*__args, **__kw)
    pywikibot/__init__.py:1201: in Site
        _sites[key] = interface(code=code, fam=fam, user=user)
    pywikibot/tools/_deprecate.py:487: in wrapper
        return obj(*new_args, **new_kwargs)
    pywikibot/site/_apisite.py:115: in __init__
        super().__init__(code, fam, user)
    pywikibot/tools/_deprecate.py:487: in wrapper
        return obj(*new_args, **new_kwargs)
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
_ _ 
    
    self = APISite("es", "wpbeta"), code = 'es', fam = Family("wpbeta"), user = 
None
    
        @remove_last_args(['sysop'])
        def __init__(self, code: str, fam=None, user=None) -> None:
            """
            Initializer.
        
            :param code: the site's language code
            :type code: str
            :param fam: wiki family name (optional)
            :type fam: str or pywikibot.family.Family
            :param user: bot user name (optional)
            :type user: str
            """
            if code.lower() != code:
                # Note the Site function in __init__ also emits a UserWarning
                # for this condition, showing the callers file and line no.
                pywikibot.log('BaseSite: code "{}" converted to lowercase'
                              .format(code))
                code = code.lower()
            if not all(x in pywikibot.family.CODE_CHARACTERS for x in code):
                pywikibot.log('BaseSite: code "{}" contains invalid characters'
                              .format(code))
            self.__code = code
            if isinstance(fam, str) or fam is None:
                self.__family = pywikibot.family.Family.load(fam)
            else:
                self.__family = fam
        
            self.obsolete = False
            # if we got an outdated language code, use the new one instead.
            if self.__code in self.__family.obsolete:
                if self.__family.obsolete[self.__code] is not None:
                    self.__code = self.__family.obsolete[self.__code]
                    # Note the Site function in __init__ emits a UserWarning
                    # for this condition, showing the callers file and line no.
                    pywikibot.log('Site {} instantiated using aliases code of 
{}'
                                  .format(self, code))
                else:
                    # no such language anymore
                    self.obsolete = True
                    pywikibot.log('Site {} instantiated and marked "obsolete" '
                                  'to prevent access'.format(self))
            elif self.__code not in self.languages():
                if self.__family.name in self.__family.langs \
                   and len(self.__family.langs) == 1:
                    self.__code = self.__family.name
                    if self.__family == pywikibot.config.family \
                       and code == pywikibot.config.mylang:
                        pywikibot.config.mylang = self.__code
                        warn('Global configuration variable "mylang" changed to 
'
                             '"{}" while instantiating site {}'
                             .format(self.__code, self), UserWarning)
                else:
                    error_msg = ("Language '{}' does not exist in family {}"
                                 .format(self.__code, self.__family.name))
    >               raise UnknownSiteError(error_msg)
    E               pywikibot.exceptions.UnknownSiteError: Language 'es' does 
not exist in family wpbeta
    
    pywikibot/site/_basesite.py:90: UnknownSiteError
  
  https://api.travis-ci.com/v3/job/521215966/log.txt

TASK DETAIL
  https://phabricator.wikimedia.org/T286117

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Xqt
Cc: Aklapper, Xqt, pywikibot-bugs-list, Jyoo1011, JohnsonLee01, SHEKH, 
Dijkstra, Khutuck, Zkhalido, Viztor, Wenyi, Tbscho, MayS, Mdupont, JJMC89, 
Dvorapa, Altostratus, Avicennasis, mys_721tx, jayvdb, Masti, Alchimista
_______________________________________________
pywikibot-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to