Revision: 5019
Author: rotem
Date: 2008-02-14 17:29:46 +0000 (Thu, 14 Feb 2008)
Log Message:
-----------
This should probably not be used. First, I think Wikimedia Error is 200, and therefore should be shown before. Second, if there *is* an error which cannot be automatically checked, the HTML should be printed IMO. Also, these are not really debug messages, else they should have been printed conditionally (with -verbose).
Modified Paths:
--------------
trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py 2008-02-14 17:24:45 UTC (rev 5018)
+++ trunk/pywikipedia/wikipedia.py 2008-02-14 17:29:46 UTC (rev 5019)
@@ -1352,21 +1352,9 @@
return self._putPage(text = text, comment = comment,
watchArticle = watchArticle, minorEdit = minorEdit, newPage = newPage,
token = None, gettoken = True, sysop = sysop)
- if response.status != 302:
- # normal response to a page save is 302
- # anything else is abnormal (and is flagged with DEBUG)
- output(
- u"Abnormal response %i from server; will try again in %i minute%s."
- % (response.status, 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 data.find("<title>Wikimedia Error</title>") > -1:
output(
- u"DEBUG:Wikimedia has technical problems; will retry in %i minute%s."
+ u"Wikimedia has technical problems; will retry in %i minute%s."
% (retry_delay, retry_delay != 1 and "s" or ""))
time.sleep(60 * retry_delay)
retry_delay *= 2
@@ -1376,7 +1364,7 @@
if data != u"":
# Something went wrong, and we don't know what. Show the
# HTML code that hopefully includes some error message.
- output(u"DEBUG:Unexpected response from wiki server.")
+ output(u"ERROR: Unexpected response from wiki server.")
output(data)
return response.status, response.reason, data
return response.status, response.reason, data