Revision: 3944 Author: wikipedian Date: 2007-08-01 23:41:57 +0000 (Wed, 01 Aug 2007)
Log Message: ----------- prevented an infinite loop when the server keeps giving httplib.BadStatusLine exceptions
Modified Paths: -------------- trunk/pywikipedia/weblinkchecker.py
Modified: trunk/pywikipedia/weblinkchecker.py =================================================================== --- trunk/pywikipedia/weblinkchecker.py 2007-08-01 23:34:27 UTC (rev 3943) +++ trunk/pywikipedia/weblinkchecker.py 2007-08-01 23:41:57 UTC (rev 3944) @@ -269,7 +269,10 @@ # e.g. http://www.radiorus.ru/ which is running on a very old # Apache server. Using GET instead works on these (but it uses # more bandwidth). - return self.resolveRedirect(useHEAD = False) + if useHEAD: + return self.resolveRedirect(useHEAD = False) + else: + raise if response.status >= 300 and response.status <= 399: #print response.getheaders() redirTarget = response.getheader('Location')
pywikipedia-l@lists.wikimedia.org