https://bugzilla.wikimedia.org/show_bug.cgi?id=56734
Web browser: --- Bug ID: 56734 Summary: intewikis Product: Pywikibot Version: unspecified Hardware: All OS: All Status: NEW Severity: major Priority: Unprioritized Component: General Assignee: Pywikipedia-bugs@lists.wikimedia.org Reporter: coet.cawiki@gmail.com Classification: Unclassified Mobile Platform: ---
I observed that Page(site, title).interwiki() doesn't work. I think it is because DataPage().get()['link'] returns something like {"nowiki":{"name: "Title", "badges": []}} and it was expected something like {"nowiki": "Title"}
Another bug i observed is that wikidata gives also the Commons link
I have modified the wikipedia.py line 4719
from "links[code]) for code in links]" to "links[code]['name']) for code in links if "commons" not in code]"
and it works fine but I think that the condition 'if "commons" not in code' is not *always* a good solution.
https://bugzilla.wikimedia.org/show_bug.cgi?id=56734
Kunal Mehta (Legoktm) legoktm.wikipedia@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|unspecified |compat (1.0)
https://bugzilla.wikimedia.org/show_bug.cgi?id=56734
Andre Klapper aklapper@wikimedia.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|intewikis |Page(site, | |title).interwiki() doesn't | |work
https://bugzilla.wikimedia.org/show_bug.cgi?id=56734
--- Comment #1 from Igor Betxí coet.cawiki@gmail.com --- I assert that "" is the unique solution and it's right because the last function keep all links related with wikipedias, and doesn't expect a commons link.
getSite(code.replace('wiki','').replace('_', '-'), fam='wikipedia')
if "commons" appears in this function it raise a NoSuchSite error because language family does not exist.
I have evaluate the following results: https://www.wikidata.org/w/api.php?action=query&format=jsonfm&prop=r... and I watch that commons link and wikivoyage links are included in the content. That means that it's necessary to exclude "commons" and "voyage" links to avoid other raise errors.
So I purpose the following change for the line 4719 of the file wikipedia.py: links[code]['name']) for code in links if "commons" not in code and "voyage" not in code]
https://bugzilla.wikimedia.org/show_bug.cgi?id=56734
--- Comment #2 from Igor Betxí coet.cawiki@gmail.com --- I meant: I assert that "links[code]['name']) for code in links if "commons" not in code]"
https://bugzilla.wikimedia.org/show_bug.cgi?id=56734
xqt info@gno.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |info@gno.de
--- Comment #3 from xqt info@gno.de --- I made a dirty hack weeks ago in https://gerrit.wikimedia.org/r/#/c/85839/ as I found that problem. Maybe we should solve it in a generic way to filter the site in the interlanguage method but keep it for some interwiki links.
pywikipedia-bugs@lists.wikimedia.org