diff options
author | Christian Faulhammer <fauli@gentoo.org> | 2010-12-07 07:55:27 +0000 |
---|---|---|
committer | Christian Faulhammer <fauli@gentoo.org> | 2010-12-07 07:55:27 +0000 |
commit | d893fb1ddf84c6738726cc3306bb97fee86b0753 (patch) | |
tree | 978b5afa84aef6e206a476cd0fca68451e4cc72c /dev-vcs/bzr/files/bzr-2.2.2-python-2.7.patch | |
parent | Initial commit, prelimary ebuild made by Nicola (diff) | |
download | gentoo-2-d893fb1ddf84c6738726cc3306bb97fee86b0753.tar.gz gentoo-2-d893fb1ddf84c6738726cc3306bb97fee86b0753.tar.bz2 gentoo-2-d893fb1ddf84c6738726cc3306bb97fee86b0753.zip |
Fix support for Python 2.7, taken from upstream, reported by Alessandro Guido <alessandro.guido+bugzilla AT gmail DOT com> in bug 347555
(Portage version: 2.1.9.24/cvs/Linux i686)
Diffstat (limited to 'dev-vcs/bzr/files/bzr-2.2.2-python-2.7.patch')
-rw-r--r-- | dev-vcs/bzr/files/bzr-2.2.2-python-2.7.patch | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/dev-vcs/bzr/files/bzr-2.2.2-python-2.7.patch b/dev-vcs/bzr/files/bzr-2.2.2-python-2.7.patch new file mode 100644 index 000000000000..88e67e0c2580 --- /dev/null +++ b/dev-vcs/bzr/files/bzr-2.2.2-python-2.7.patch @@ -0,0 +1,40 @@ +=== modified file 'bzrlib/transport/http/_urllib2_wrappers.py' +--- bzrlib/transport/http/_urllib2_wrappers.py 2010-05-08 05:56:28 +0000 ++++ bzrlib/transport/http/_urllib2_wrappers.py 2010-09-15 02:43:44 +0000 +@@ -75,6 +75,26 @@ + ) + + ++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): +@@ -656,7 +676,7 @@ + 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 + |