[Checkins] SVN: lovely.buildouthttp/trunk/ avoid an error when the realm is wrong or the file on bad realms and a few other controls. Thanks to Tarek Ziad?\195?\169.

Jodok Batlogg jodok.batlogg at lovelysystems.com
Sat Dec 8 04:22:56 EST 2007


Log message for revision 82194:
  avoid an error when the realm is wrong or the file on bad realms and a few  other controls. Thanks to Tarek Ziad?\195?\169.
  
  

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

-=-
Modified: lovely.buildouthttp/trunk/CHANGES.txt
===================================================================
--- lovely.buildouthttp/trunk/CHANGES.txt	2007-12-08 00:57:26 UTC (rev 82193)
+++ lovely.buildouthttp/trunk/CHANGES.txt	2007-12-08 09:22:55 UTC (rev 82194)
@@ -2,6 +2,11 @@
 Changes for lovely.buildouthttp
 ===============================
 
+2007/12/08 0.2.1:
+=================
+- avoid an error when the realm is wrong or the file on bad realms and a few 
+  other controls. Thanks to Tarek Ziadé.
+
 2007/08/06 0.2.0a1:
 ===================
 

Modified: lovely.buildouthttp/trunk/setup.py
===================================================================
--- lovely.buildouthttp/trunk/setup.py	2007-12-08 00:57:26 UTC (rev 82193)
+++ lovely.buildouthttp/trunk/setup.py	2007-12-08 09:22:55 UTC (rev 82194)
@@ -16,7 +16,7 @@
 name='lovely.buildouthttp'
 setup(
     name = name,
-    version = "0.2.0a1",
+    version = "0.2.1",
     author = "Lovely Systems GmbH",
     author_email = "office at lovelysystems.com",
     description = "Specialized zc.buildout plugin to add http basic" \

Modified: lovely.buildouthttp/trunk/src/lovely/buildouthttp/buildouthttp.py
===================================================================
--- lovely.buildouthttp/trunk/src/lovely/buildouthttp/buildouthttp.py	2007-12-08 00:57:26 UTC (rev 82193)
+++ lovely.buildouthttp/trunk/src/lovely/buildouthttp/buildouthttp.py	2007-12-08 09:22:55 UTC (rev 82194)
@@ -29,7 +29,9 @@
         res =  urllib2.HTTPBasicAuthHandler.http_error_401(self,req, fp, code,
                                                            msg,
                                                            headers)
-        if res.code>=400:
+        if res is None:
+            log.error('failed to get url: %r, check your realm' % res.url)
+        elif res.code>=400:
             log.error('failed to get url: %r %r' % (res.url, res.code))
         else:
             log.debug('got url: %r %r' % (res.url, res.code))
@@ -46,7 +48,9 @@
     reader = csv.reader(pwdsf)
     auth_handler = CredHandler()
     for row in reader:
-        realm, uris, user, password = row
+        if len(row) != 4:
+            continue
+        realm, uris, user, password = (el.strip() for el in row)
         log.debug('Added credentials %r, %r' % (realm, uris))
         auth_handler.add_password(realm, uris, user, password)
         handlers = []



More information about the Checkins mailing list