https://bugzilla.wikimedia.org/show_bug.cgi?id=69842
Bug ID: 69842 Summary: pywikibot.Link malfunction on commons (and likely meta) Product: Pywikibot Version: unspecified Hardware: All OS: All Status: UNCONFIRMED Severity: major Priority: Unprioritized Component: General Assignee: Pywikipedia-bugs@lists.wikimedia.org Reporter: zhuyifei1999@gmail.com CC: info@gno.de Web browser: --- Mobile Platform: ---
Expected output: $ python Python 2.7.3 (default, Feb 27 2014, 19:58:35) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information.
import pywikibot pywikibot.Link("en:", pywikibot.Site("commons", "commons")).site
Site("en", "wikipedia")
pywikibot.Link("wikipedia:", pywikibot.Site("commons", "commons")).site
Site("en", "wikipedia")
----
In fact: $ python Python 2.7.3 (default, Feb 27 2014, 19:58:35) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information.
import pywikibot pywikibot.Link("en:", pywikibot.Site("commons", "commons")).site
Site("commons", "commons")
pywikibot.Link("wikipedia:", pywikibot.Site("commons", "commons")).site
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "pywikibot/page.py", line 3777, in site self.parse() File "pywikibot/page.py", line 3700, in parse newsite = pywikibot.Site(otherlang, familyName) File "pywikibot/__init__.py", line 528, in Site _sites[key] = __Site(code=code, fam=fam, user=user, sysop=sysop) File "pywikibot/site.py", line 1186, in __init__ BaseSite.__init__(self, code, fam, user, sysop) File "pywikibot/site.py", line 449, in __init__ % (self.__code, self.__family.name)) pywikibot.exceptions.NoSuchSite: Language commons does not exist in family wikipedia