Revision: 5223 Author: wikipedian Date: 2008-04-16 10:36:16 +0000 (Wed, 16 Apr 2008)
Log Message: ----------- Retry putting the page after some time when the database is locked for write access.
Modified Paths: -------------- trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2008-04-16 10:23:09 UTC (rev 5222) +++ trunk/pywikipedia/wikipedia.py 2008-04-16 10:36:16 UTC (rev 5223) @@ -1359,6 +1359,14 @@ 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')): + 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) + retry_delay *= 2 + if retry_delay > 30: + retry_delay = 30 + continue if self.site().has_mediawiki_message('longpageerror'): # FIXME: Long page error detection isn't working in Vietnamese Wikipedia. long_page_errorR = re.compile(
pywikipedia-l@lists.wikimedia.org