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
https://bugzilla.wikimedia.org/show_bug.cgi?id=69842
Merlijn van Deen valhallasw@arctus.nl changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |valhallasw@arctus.nl Version|unspecified |core (2.0) Summary|pywikibot.Link malfunction |commons -> wikipedia |on commons (and likely |interfamily link not |meta) |supported
https://bugzilla.wikimedia.org/show_bug.cgi?id=69842
Fabian CommodoreFabianus@gmx.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW CC| |CommodoreFabianus@gmx.de Ever confirmed|0 |1
--- Comment #1 from Fabian CommodoreFabianus@gmx.de --- This looks like a bug:
pywikibot.Link("en:Main Page", pywikibot.Site("commons", "commons")).site
Site("commons", "commons")
pywikibot.Link("en:Main Page", pywikibot.Site("de", "wikipedia")).site
Site("en", "wikipedia")
https://bugzilla.wikimedia.org/show_bug.cgi?id=69842
John Mark Vandenberg jayvdb@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jayvdb@gmail.com
--- Comment #2 from John Mark Vandenberg jayvdb@gmail.com --- Definitely a valid use case which doesnt work. It is uppercasing the first letter, which means it thinks it is a page title with a namespace.
pywikibot.Link("en:", pywikibot.Site("commons", "commons")).title
u'En:'
pywikibot.Link("en:Main Page", pywikibot.Site("commons", "commons")).title
u'En:Main Page'
While I didnt know about this bug, this changeset was started to identify the problem, so we can track fixing it.
https://gerrit.wikimedia.org/r/#/c/149629/
https://bugzilla.wikimedia.org/show_bug.cgi?id=69842
--- Comment #3 from Gerrit Notification Bot gerritadmin@wikimedia.org --- Change 157337 had a related patch set uploaded by Zhuyifei1999: Add support for single-lang families -> multi-lang families interfamily link
https://gerrit.wikimedia.org/r/157337
https://bugzilla.wikimedia.org/show_bug.cgi?id=69842
Gerrit Notification Bot gerritadmin@wikimedia.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |PATCH_TO_REVIEW
https://bugzilla.wikimedia.org/show_bug.cgi?id=69842
--- Comment #4 from Gerrit Notification Bot gerritadmin@wikimedia.org --- Change 157337 abandoned by Zhuyifei1999: Add support for single-lang families -> multi-lang families interfamily link
Reason: Looks like Iec4f32fdefde15b2330dbb191fb3bbb0d04803e2 can do a better job on this.
https://gerrit.wikimedia.org/r/157337
https://bugzilla.wikimedia.org/show_bug.cgi?id=69842
zhuyifei1999 zhuyifei1999@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|PATCH_TO_REVIEW |RESOLVED Resolution|--- |FIXED
--- Comment #5 from zhuyifei1999 zhuyifei1999@gmail.com --- Fixed in Iec4f32fdefde15b2330dbb191fb3bbb0d04803e2
pywikipedia-bugs@lists.wikimedia.org