[Checkins] SVN: lovely.buildouthttp/trunk/ fixed behavour with python 2.6+. buildout failed on every 5th request in a single run

Adam Groszer agroszer at gmail.com
Thu Sep 23 08:16:01 EDT 2010


Log message for revision 116763:
  fixed behavour with python 2.6+. buildout failed on every 5th request in a single run

Changed:
  U   lovely.buildouthttp/trunk/CHANGES.txt
  U   lovely.buildouthttp/trunk/src/lovely/buildouthttp/buildouthttp.py

-=-
Modified: lovely.buildouthttp/trunk/CHANGES.txt
===================================================================
--- lovely.buildouthttp/trunk/CHANGES.txt	2010-09-23 11:49:54 UTC (rev 116762)
+++ lovely.buildouthttp/trunk/CHANGES.txt	2010-09-23 12:16:01 UTC (rev 116763)
@@ -2,6 +2,14 @@
 Changes for lovely.buildouthttp
 ===============================
 
+unreleased 0.3.4:
+=================
+
+- fixed behavour with python 2.6+. python 2.6 suddenly counts ``failed`` requests
+  but each request without auth counts as one, that makes buildout fail on
+  every 5th download in a single run.
+  I found this on windows, but should fail on linux too.
+
 2010/08/28 0.3.3:
 =================
 

Modified: lovely.buildouthttp/trunk/src/lovely/buildouthttp/buildouthttp.py
===================================================================
--- lovely.buildouthttp/trunk/src/lovely/buildouthttp/buildouthttp.py	2010-09-23 11:49:54 UTC (rev 116762)
+++ lovely.buildouthttp/trunk/src/lovely/buildouthttp/buildouthttp.py	2010-09-23 12:16:01 UTC (rev 116763)
@@ -87,6 +87,14 @@
     """
 
     def http_error_401(self, req, fp, code, msg, headers):
+        try:
+            #python 2.6 introduces this attribute and fails the request on 5
+            #but since we're process global this fails on the 5th download
+            #there's no reset_retry_count(), so clear it here:
+            self.retried = 0
+        except AttributeError:
+            pass
+
         log.debug('getting url: %r' % req.get_full_url())
         try:
             res =  urllib2.HTTPBasicAuthHandler.http_error_401(



More information about the checkins mailing list