Merge lp:~jelmer/brz/python3-git-fix-http into lp:brz

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: no longer in the source branch.
Merge reported by: The Breezy Bot
Merged at revision: not available
Proposed branch: lp:~jelmer/brz/python3-git-fix-http
Merge into: lp:brz
Diff against target: 36 lines (+3/-5)
2 files modified
breezy/git/__init__.py (+1/-1)
breezy/git/remote.py (+2/-4)
To merge this branch: bzr merge lp:~jelmer/brz/python3-git-fix-http
Reviewer Review Type Date Requested Status
Martin Packman Approve
Review via email: mp+356238@code.launchpad.net

Commit message

Remove unnecessary redirect handling for git.

Description of the change

Remove unnecessary redirect handling; this happens on a higher level now and breaks with Python 3.

To post a comment you must log in.
Revision history for this message
Martin Packman (gz) wrote :

Makes sense, thanks.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'breezy/git/__init__.py'
2--- breezy/git/__init__.py 2018-09-13 00:18:48 +0000
3+++ breezy/git/__init__.py 2018-10-08 07:28:20 +0000
4@@ -164,7 +164,7 @@
5 if resp.code in (404, 405):
6 raise bzr_errors.NotBranchError(transport.base)
7 headers = resp.headers
8- ct = headers.getheader("Content-Type")
9+ ct = headers.get("Content-Type")
10 if ct is None:
11 raise bzr_errors.NotBranchError(transport.base)
12 if ct.startswith("application/x-git"):
13
14=== modified file 'breezy/git/remote.py'
15--- breezy/git/remote.py 2018-09-14 09:56:35 +0000
16+++ breezy/git/remote.py 2018-10-08 07:28:20 +0000
17@@ -629,9 +629,8 @@
18 :param data: Request data.
19 :param allow_compression: Allow GZipped communication.
20 :return: Tuple (`response`, `read`), where response is an `urllib3`
21- response object with additional `content_type` and
22- `redirect_location` properties, and `read` is a consumable read
23- method for the response data.
24+ response object with additional `content_type` property,
25+ and `read` is a consumable read method for the response data.
26 """
27 from breezy.transport.http._urllib2_wrappers import Request
28 headers['User-agent'] = user_agent_for_github()
29@@ -671,7 +670,6 @@
30 self._response = response
31 self.status = response.code
32 self.content_type = response.getheader("Content-Type")
33- self.redirect_location = response.geturl()
34
35 def close(self):
36 self._response.close()

Subscribers

People subscribed via source and target branches