Dalba created this task.
Dalba added projects: Pywikibot-core, Pywikibot-tests.
Herald added subscribers: pywikibot-bugs-list, Aklapper.

TASK DESCRIPTION

https://travis-ci.org/wikimedia/pywikibot/jobs/399543989#L1538

________________________ TestPageObject.test_talk_page _________________________
self = <tests.page_tests.TestPageObject testMethod=test_talk_page>
    def test_talk_page(self):
        """Test various methods that rely on API: talk page."""
        mainpage = self.get_mainpage()
        maintalk = mainpage.toggleTalkPage()
        if not maintalk.exists():
            raise unittest.SkipTest("No talk page for %s's main page"
                                    % self.get_site())
>       self.assertIsInstance(maintalk.get(), unicode)
tests/page_tests.py:459: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
pywikibot/tools/__init__.py:1450: in wrapper
    return obj(*__args, **__kw)
pywikibot/page.py:477: in get
    self._getInternals(sysop)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = Page(Talk:Main Page), sysop = False
    def _getInternals(self, sysop):
        """
            Helper function for get().
    
            Stores latest revision in self if it doesn't contain it, doesn't think.
            * Raises exceptions from previous runs.
            * Stores new exceptions in _getexception and raises them.
            """
        # Raise exceptions from previous runs
        if hasattr(self, '_getexception'):
            raise self._getexception
    
        # If not already stored, fetch revision
        if self._latest_cached_revision() is None:
            try:
                self.site.loadrevisions(self, content=True, sysop=sysop)
            except (pywikibot.NoPage, pywikibot.SectionError) as e:
                self._getexception = e
                raise
    
        # self._isredir is set by loadrevisions
        if self._isredir:
            self._getexception = pywikibot.IsRedirectPage(self)
>           raise self._getexception
E           IsRedirectPage: Page [[en:Talk:Main Page]] is a redirect page.
pywikibot/page.py:515: IsRedirectPage
______________ TestSiteGenerators.test_allpages_langlinks_enabled ______________
self = <tests.site_tests.TestSiteGenerators testMethod=test_allpages_langlinks_enabled>
    def test_allpages_langlinks_enabled(self):
        """Test allpages with langlinks enabled."""
        mysite = self.get_site()
        for page in mysite.allpages(
                filterlanglinks=True, total=3, namespace=4):
            self.assertIsInstance(page, pywikibot.Page)
            self.assertTrue(page.exists())
            self.assertEqual(page.namespace(), 4)
>           self.assertNotEqual(page.langlinks(), [])
tests/site_tests.py:680: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
pywikibot/page.py:1499: in langlinks
    self._langlinks = list(self.iterlanglinks(include_obsolete=True))
pywikibot/site.py:4145: in pagelanglinks
    source=self)
pywikibot/page.py:5879: in langlinkUnsafe
    link._site = pywikibot.Site(lang, source.family.name)
pywikibot/__init__.py:1275: in Site
    _sites[key] = interface(code=code, fam=fam, user=user, sysop=sysop)
pywikibot/site.py:1845: in __init__
    BaseSite.__init__(self, code, fam, user, sysop)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = APISite("af", "wpbeta"), code = 'af', fam = Family("wpbeta"), user = None
sysop = None
    def __init__(self, code, fam=None, user=None, sysop=None):
        """
            Initializer.
    
            @param code: the site's language code
            @type code: str
            @param fam: wiki family name (optional)
            @type fam: str or Family
            @param user: bot user name (optional)
            @type user: str
            @param sysop: sysop account user name (optional)
            @type sysop: 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(u'BaseSite: code "%s" converted to lowercase' % code)
            code = code.lower()
        if not all(x in pywikibot.family.CODE_CHARACTERS for x in str(code)):
            pywikibot.log(u'BaseSite: code "%s" contains invalid characters'
                          % code)
        self.__code = code
        if isinstance(fam, basestring) 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(u'Site %s instantiated using code %s'
                              % (self, code))
            else:
                # no such language anymore
                self.obsolete = True
                pywikibot.log(u'Site %s instantiated and marked "obsolete" '
                              u'to prevent access' % self)
        elif self.__code not in self.languages():
            if self.__family.name in list(self.__family.langs.keys()) 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(u'Global configuration variable "mylang" changed to '
                         u'"%s" while instantiating site %s'
                         % (self.__code, self), UserWarning)
            else:
                raise UnknownSite(u"Language '%s' does not exist in family %s"
>                                 % (self.__code, self.__family.name))
E               UnknownSite: Language 'af' does not exist in family wpbeta

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

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

To: Dalba
Cc: Aklapper, pywikibot-bugs-list, Dalba, Magul, Tbscho, MayS, Mdupont, JJMC89, Avicennasis, mys_721tx, jayvdb, Masti, Alchimista, Rxy
_______________________________________________
pywikibot-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs

Reply via email to