Blob Blame History Raw
diff -up bzr-2.2.4/bzrlib/transport/http/_urllib2_wrappers.py.5439 bzr-2.2.4/bzrlib/transport/http/_urllib2_wrappers.py
--- bzr-2.2.4/bzrlib/transport/http/_urllib2_wrappers.py.5439	2011-02-04 13:32:04.000000000 +0100
+++ bzr-2.2.4/bzrlib/transport/http/_urllib2_wrappers.py	2011-04-28 22:09:24.377398570 +0200
@@ -75,6 +75,26 @@ from bzrlib import (
     )
 
 
+class addinfourl(urllib2.addinfourl):
+    '''Replacement addinfourl class compatible with python-2.7's xmlrpclib
+
+    In python-2.7, xmlrpclib expects that the response object that it receives
+    has a getheader method.  httplib.HTTPResponse provides this but
+    urllib2.addinfourl does not.  Add the necessary functions here, ported to
+    use the internal data structures of addinfourl.
+    '''
+
+    def getheader(self, name, default=None):
+        if self.headers is None:
+            raise httplib.ResponseNotReady()
+        return self.headers.getheader(name, default)
+
+    def getheaders(self):
+        if self.headers is None:
+            raise httplib.ResponseNotReady()
+        return self.headers.items()
+
+
 class _ReportingFileSocket(object):
 
     def __init__(self, filesock, report_activity=None):
@@ -660,7 +680,7 @@ class AbstractHTTPHandler(urllib2.Abstra
             r = response
             r.recv = r.read
             fp = socket._fileobject(r, bufsize=65536)
-            resp = urllib2.addinfourl(fp, r.msg, req.get_full_url())
+            resp = addinfourl(fp, r.msg, req.get_full_url())
             resp.code = r.status
             resp.msg = r.reason
             resp.version = r.version
diff -up bzr-2.2.4/NEWS.5439 bzr-2.2.4/NEWS
--- bzr-2.2.4/NEWS.5439	2011-02-04 13:32:04.000000000 +0100
+++ bzr-2.2.4/NEWS	2011-04-28 22:15:01.251187067 +0200
@@ -135,6 +135,12 @@ This is a bugfix release which also incl
 2.1.3. None are critical, but upgrading is recommended for all users on
 earlier 2.2 releases.
 
+Fedora Backported Bug Fixes
+***************************
+
+* Fix traceback with python-2.7's xmlrpclib
+  (Toshio Kuratomi, #612096)
+
 Bug Fixes
 *********