Last modified: 2014-05-06 00:41:42 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 T63120, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 61120 - pywikibot.Link.langlinkUnsafe can't deal with obsolete sites
pywikibot.Link.langlinkUnsafe can't deal with obsolete sites
Status: RESOLVED FIXED
Product: Pywikibot
Classification: Unclassified
General (Other open bugs)
core-(2.0)
All All
: Unprioritized normal
: ---
Assigned To: Pywikipedia bugs
:
Depends on:
Blocks: 55146 57050
  Show dependency treegraph
 
Reported: 2014-02-10 04:07 UTC by Sorawee Porncharoenwase
Modified: 2014-05-06 00:41 UTC (History)
2 users (show)

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


Attachments

Description Sorawee Porncharoenwase 2014-02-10 04:07:52 UTC
print list(pywikibot.Page(pywikibot.getSite("af"), "Maan").iterlanglinks())
raises NoSuchSite exception

I actually encountered this problem when I ran featured.py. It seems that there is an attempt (gerrit: 112322) to fix this problem, but the problem still persists.
Comment 1 Sorawee Porncharoenwase 2014-02-10 04:12:25 UTC
Oh! I forgot to mention that the above code fails because iterlanglinks() will call pywikibot.Link.langlinkUnsafe.

There are two places calling pywikibot.Link.langlinkUnsafe: in iterlanglinks() and in update_page() from api.py. I don't which way is better between putting try-except block inside pywikibot.Link.langlinkUnsafe directly, and putting try-except block in caller functions over pywikibot.Link.langlinkUnsafe.
Comment 2 Gerrit Notification Bot 2014-02-12 02:41:11 UTC
Change 112842 had a related patch set uploaded by Nullzero:
Prevent NoSuchSite error from reading obsolete site's language link

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

https://gerrit.wikimedia.org/r/112842
Comment 4 xqt 2014-03-18 14:52:27 UTC
Patch reverted with https://gerrit.wikimedia.org/r/#/c/119277/
Comment 5 Sorawee Porncharoenwase 2014-05-06 00:41:42 UTC
Merged

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


Navigation
Links