Revision: 4872 Author: rotem Date: 2008-01-13 17:39:19 +0000 (Sun, 13 Jan 2008)
Log Message: ----------- (bug 1867154) Detecting non-existant pages even when the 'view source' tab does not exist, as in the newest versions.
Modified Paths: -------------- trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2008-01-13 17:28:48 UTC (rev 4871) +++ trunk/pywikipedia/wikipedia.py 2008-01-13 17:39:19 UTC (rev 4872) @@ -689,6 +689,10 @@ # locked elif text.find(self.site().mediawiki_message('viewsource')) != -1: raise NoPage(self.site(), self.aslink(forceInterwiki = True)) + # Some of the newest versions don't have a "view source" tag for + # non-existant pages + elif text.find(self.site().mediawiki_message('badaccess')) != -1: + raise NoPage(self.site(), self.aslink(forceInterwiki = True)) else: if text.find( "<title>Wikimedia Error</title>") > -1: output( u"Wikimedia has technical problems; will retry in %i minutes." % retry_idle_time)