Last modified: 2014-05-06 00:44:19 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 T57146, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 55146 - interwiki() fails for closed wikipedia
interwiki() fails for closed wikipedia
Status: RESOLVED FIXED
Product: Pywikibot
Classification: Unclassified
General (Other open bugs)
unspecified
All All
: Unprioritized normal
: ---
Assigned To: Pywikipedia bugs
:
Depends on: 61120
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-05 04:32 UTC by Kunal Mehta (Legoktm)
Modified: 2014-05-06 00:44 UTC (History)
3 users (show)

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


Attachments

Description Kunal Mehta (Legoktm) 2013-10-05 04:32:12 UTC
Originally from: http://sourceforge.net/p/pywikipediabot/bugs/1608/
Reported by: cdpark
Created on: 2013-04-04 01:32:44
Subject: interwiki() fails for closed wikipedia
Assigned to: amird
Original description:
Page.interwiki\(\) and PageData.interwiki\(\) fails when wikidata contains sitelinks of closed wikipedias.

For example, following code is broken now.

\---------------------------------------------------------------------------------------------------
\#\!/usr/bin/python
\# -\*- coding: utf-8 -\*-

import pywikibot

en = pywikibot.getSite\('en', 'wikipedia'\)
mainpage = pywikibot.Page\(en, u'Main Page'\)
interwiki = mainpage.interwiki\(\)

print interwiki

\--------------------------------------------------------------------------------------------------------------
Comment 1 Kunal Mehta (Legoktm) 2013-10-05 04:32:14 UTC
- **assigned_to**: nobody --> amird
Comment 2 Kunal Mehta (Legoktm) 2013-10-05 04:32:16 UTC
I posted this on the ML about a month ago \(http://lists.wikimedia.org/pipermail/pywikipedia-l/2013-March/007766.html\) and assumed that because no one responded it wasn't a big deal so I didn't bother fixing it.
This issue is more than just interwiki links, it's that we prevent read \(and write for stewards\) access for a locked \(but readable\) wiki.

I think the best way to fix it would be to split that list of obsolete wiki's into 3: locked, deleted, and obsolete \(renamed, backwards compatibility\), and then any wiki that is deleted/obsolete throw an error, but locked does not.

\(Setting group to none since this also affects rewrite branch\)
Comment 3 Kunal Mehta (Legoktm) 2013-10-05 04:32:18 UTC
- **milestone**: 346788 --> 
- **labels**: 745455 -->
Comment 4 Kunal Mehta (Legoktm) 2013-10-05 04:32:20 UTC
The problem is from API:
http://en.wikipedia.org/w/api.php?action=query&format=jsonfm&titles=Main%20Page&prop=langlinks
in comprehension of:
http://en.wikipedia.org/w/api.php?action=query&format=jsonfm&titles=Persian%20Wikipedia&prop=langlinks
legoktm: I think your idea is good but unrelated, none of these wikis are obsolete
Comment 5 Kunal Mehta (Legoktm) 2013-10-05 04:32:22 UTC
Sorry, I misunderstood but every time i run the code on Main Page,bot returns me invalid title because the iws are invalid titles:
http://en.wikipedia.org/w/index.php?title=Template:Main\_Page\_interwikis&action=edit

can you give me another example \(e.g. a test userspace page\)
Comment 6 Gerrit Notification Bot 2014-02-26 21:36:50 UTC
Change 112842 had a related patch set uploaded by Nullzero:
Make obsolete site object can be created

https://gerrit.wikimedia.org/r/112842
Comment 7 Gerrit Notification Bot 2014-03-13 22:51:11 UTC
Change 112842 merged by jenkins-bot:
Make obsolete site object can be created

https://gerrit.wikimedia.org/r/112842
Comment 8 xqt 2014-03-18 14:51:58 UTC
Patch reverted with https://gerrit.wikimedia.org/r/#/c/119277/
Comment 9 Sorawee Porncharoenwase 2014-05-06 00:44:19 UTC
Merged

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


Navigation
Links