[Checkins] SVN: lovely.buildouthttp/trunk/ don't overwrite handlers in case a handler already exists. (e.g. in paramiko) thanks to Aaron Lehmann

Jodok Batlogg jodok.batlogg at lovelysystems.com
Mon Aug 6 09:07:13 EDT 2007


Log message for revision 78626:
  don't overwrite handlers in case a handler already exists. (e.g. in paramiko) thanks to Aaron Lehmann 
  
  

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-08-06 08:45:35 UTC (rev 78625)
+++ lovely.buildouthttp/trunk/CHANGES.txt	2007-08-06 13:07:12 UTC (rev 78626)
@@ -2,6 +2,12 @@
 Changes for lovely.buildouthttp
 ===============================
 
+2007/08/06 0.2.0a1:
+===================
+
+- don't overwrite handlers in case a handler already exists. (e.g. in paramiko)
+  thanks to Aaron Lehmann 
+
 2007/07/23 0.1.0a3:
 ===================
 

Modified: lovely.buildouthttp/trunk/setup.py
===================================================================
--- lovely.buildouthttp/trunk/setup.py	2007-08-06 08:45:35 UTC (rev 78625)
+++ lovely.buildouthttp/trunk/setup.py	2007-08-06 13:07:12 UTC (rev 78626)
@@ -16,7 +16,7 @@
 name='lovely.buildouthttp'
 setup(
     name = name,
-    version = "0.1.0a3",
+    version = "0.2.0a1",
     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-08-06 08:45:35 UTC (rev 78625)
+++ lovely.buildouthttp/trunk/src/lovely/buildouthttp/buildouthttp.py	2007-08-06 13:07:12 UTC (rev 78626)
@@ -49,5 +49,9 @@
         realm, uris, user, password = row
         log.debug('Added credentials %r, %r' % (realm, uris))
         auth_handler.add_password(realm, uris, user, password)
-    opener = urllib2.build_opener(auth_handler)
-    urllib2.install_opener(opener)
+        handlers = []
+        if urllib2._opener is not None:
+            handlers[:] = urllib2._opener.handlers
+        handlers.insert(0, auth_handler)
+        opener = urllib2.build_opener(*handlers)
+        urllib2.install_opener(opener)



More information about the Checkins mailing list