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

TASK DESCRIPTION
___ PageGeneratorIntersectTestCase.test_intersect_newpages_and_recentchanges ___
self = <tests.pagegenerators_tests.PageGeneratorIntersectTestCase testMethod=test_intersect_newpages_and_recentchanges>
    def test_intersect_newpages_and_recentchanges(self):
        """Test intersection betweem newpages and recentchanges."""
        site = self.get_site()
        self.assertEqualItertools(
            [pagegenerators.NewpagesPageGenerator(site=site, total=50),
>            pagegenerators.RecentChangesPageGenerator(site=site, total=200)])
tests/pagegenerators_tests.py:1416: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/thread_tests.py:52: in assertEqualItertools
    set_result = set(datasets[0]).intersection(*datasets[1:])
pywikibot/page.py:419: in __hash__
    return hash(unicode(self))
pywikibot/tools/__init__.py:222: in __str__
    return self.__unicode__()
pywikibot/page.py:387: in __unicode__
    return self.title(asLink=True, forceInterwiki=True)
pywikibot/tools/__init__.py:1446: in wrapper
    return obj(*__args, **__kw)
pywikibot/page.py:322: in title
    title = self._link.canonical_title()
pywikibot/page.py:5732: in canonical_title
    if self.namespace != Namespace.MAIN:
pywikibot/page.py:5693: in namespace
    self.parse()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <[InvalidTitle("'User:#8391714' has no title.") raised in repr()] Link object at 0x7f2150b6d080>
    def parse(self):
        """
            Parse wikitext of the link.
    
            Called internally when accessing attributes.
            """
        self._site = self._source
        self._namespace = self._defaultns
        self._is_interwiki = False
        ns_prefix = False
    
        old_position = int(self._text.startswith(':'))
        colon_position = self._text.find(':', old_position)
        first_other_site = None
        while colon_position >= 0:
            prefix = self._text[old_position:colon_position].lower()
            # All spaces after a prefix are discarded
            colon_position += 1
            while (len(self._text) > colon_position and
                    self._text[colon_position] == ' '):
                colon_position += 1
            ns = self._site.namespaces.lookup_name(prefix)
            if ns:
                if len(self._text) <= colon_position:
                    raise pywikibot.InvalidTitle(
                        "'{0}' has no title.".format(self._text))
                self._namespace = ns
                ns_prefix = True
                old_position = colon_position
                break
    
            try:
                newsite = self._site.interwiki(prefix)
            except KeyError:
                break  # text before : doesn't match any known prefix
            except SiteDefinitionError as e:
                raise SiteDefinitionError(
                    '{0} is not a local page on {1}, and the interwiki '
                    'prefix {2} is not supported by Pywikibot!\n{3}'
                    .format(self._text, self._site, prefix, e))
            else:
                if first_other_site:
                    if not self._site.local_interwiki(prefix):
                        raise pywikibot.InvalidTitle(
                            u'{0} links to a non local site {1} via an '
                            'interwiki link to {2}.'.format(
                                self._text, newsite, first_other_site))
                elif newsite != self._source:
                    first_other_site = newsite
                self._site = newsite
                self._is_interwiki = True
            old_position = colon_position
            colon_position = self._text.find(':', old_position)
    
        # Remove any namespaces/interwiki prefixes
        t = self._text[old_position:]
    
        if u"#" in t:
            t, sec = t.split(u'#', 1)
            t, self._section = t.rstrip(), sec.lstrip()
        else:
            self._section = None
    
        if ns_prefix:
            # 'namespace:' is not a valid title
            if not t:
                raise pywikibot.InvalidTitle(
>                   u"'{0}' has no title.".format(self._text))
E               pywikibot.exceptions.InvalidTitle: 'User:#8391714' has no title.

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

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

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

Reply via email to