Revision: 5224 Author: wikipedian Date: 2008-04-16 10:40:54 +0000 (Wed, 16 Apr 2008)
Log Message: ----------- Wikimedia server message seems to have been changed
Modified Paths: -------------- trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2008-04-16 10:36:16 UTC (rev 5223) +++ trunk/pywikipedia/wikipedia.py 2008-04-16 10:40:54 UTC (rev 5224) @@ -1350,7 +1350,10 @@ # We might have been using an outdated token output(u"Changing page has failed. Retrying.") return self._putPage(text, comment, watchArticle, minorEdit, newPage, token=self.site().getToken(sysop = sysop, getagain = True), newToken = True, sysop = sysop) - if data.find("<title>Wikimedia Error</title>") > -1: + # I think the error message title was changed from "Wikimedia Error" + # to "Wikipedia has a problem", but I'm not sure. Maybe we could + # just check for HTTP Status 500 (Internal Server Error)? + if "<title>Wikimedia Error</title>" in data or "has a problem</title>" in data: output( u"Wikimedia has technical problems; will retry in %i minute%s." % (retry_delay, retry_delay != 1 and "s" or "")) @@ -1359,7 +1362,7 @@ if retry_delay > 30: retry_delay = 30 continue - if data.find(self.site().mediawiki_message('readonly')) or data.find(self.site().mediawiki_message('readonly_lag')): + if self.site().mediawiki_message('readonly') in data or self.site().mediawiki_message('readonly_lag') in data: output(u"The database is currently locked for write access; will retry in %i minute%s." % (retry_delay, retry_delay != 1 and "s" or "")) time.sleep(60 * retry_delay)
pywikipedia-l@lists.wikimedia.org