Last modified: 2014-10-14 12:17:33 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T71842, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 69842 - commons -> wikipedia interfamily link not supported
commons -> wikipedia interfamily link not supported
Status: RESOLVED FIXED
Product: Pywikibot
Classification: Unclassified
General (Other open bugs)
core-(2.0)
All All
: Unprioritized major
: ---
Assigned To: Pywikipedia bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-08-21 09:12 UTC by zhuyifei1999
Modified: 2014-10-14 12:17 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description zhuyifei1999 2014-08-21 09:12:37 UTC
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
Comment 1 Fabian 2014-08-21 09:46:50 UTC
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")
Comment 2 John Mark Vandenberg 2014-08-21 11:50:35 UTC
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/
Comment 3 Gerrit Notification Bot 2014-08-30 05:26:56 UTC
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
Comment 4 Gerrit Notification Bot 2014-10-09 12:48:54 UTC
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
Comment 5 zhuyifei1999 2014-10-14 12:17:33 UTC
Fixed in Iec4f32fdefde15b2330dbb191fb3bbb0d04803e2

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links