Merge lp:~vila/bzr/1645017-pycurl-proxy-tests into lp:bzr/2.7

Proposed by Vincent Ladeuil on 2017-01-15
Status: Merged
Approved by: Vincent Ladeuil on 2017-01-15
Approved revision: 6620
Merged at revision: 6620
Proposed branch: lp:~vila/bzr/1645017-pycurl-proxy-tests
Merge into: lp:bzr/2.7
Diff against target: 102 lines (+48/-1)
3 files modified
bzrlib/tests/test_http.py (+6/-1)
bzrlib/transport/http/_pycurl.py (+4/-0)
doc/en/release-notes/bzr-2.7.txt (+38/-0)
To merge this branch: bzr merge lp:~vila/bzr/1645017-pycurl-proxy-tests
Reviewer Review Type Date Requested Status
Jelmer Vernooij (community) 2017-01-15 Approve on 2017-01-15
Review via email: mp+314783@code.launchpad.net

Commit message

Fix pycurl proxy tests for newer and stricter pycurl versions.

Description of the change

This fixes the test failures starting with recent version of pycurl becoming stricter about the accepted proxy urls.

Using 'http+pycurl:' is not allowed anymore and should just be 'http:'

Only tests are affected.

To post a comment you must log in.
6620. By Vincent Ladeuil on 2017-01-15

Merge 2.7 fixing conflicts

Jelmer Vernooij (jelmer) wrote :

This should probably also go into bzr.dev

review: Approve
Vincent Ladeuil (vila) wrote :

> This should probably also go into bzr.dev

/me nods

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bzrlib/tests/test_http.py'
2--- bzrlib/tests/test_http.py 2016-09-09 12:59:40 +0000
3+++ bzrlib/tests/test_http.py 2017-01-15 18:54:57 +0000
4@@ -1283,6 +1283,8 @@
5 self.no_proxy_host = self.server_host_port
6 # The secondary server is the proxy
7 self.proxy_url = self.get_secondary_url()
8+ if self._testing_pycurl():
9+ self.proxy_url = self.proxy_url.replace('+pycurl', '')
10
11 def _testing_pycurl(self):
12 # TODO: This is duplicated for lots of the classes in this file
13@@ -1863,7 +1865,10 @@
14 ])
15
16 def get_user_transport(self, user, password):
17- self.overrideEnv('all_proxy', self.get_user_url(user, password))
18+ proxy_url = self.get_user_url(user, password)
19+ if self._testing_pycurl():
20+ proxy_url = proxy_url.replace('+pycurl', '')
21+ self.overrideEnv('all_proxy', proxy_url)
22 return TestAuth.get_user_transport(self, user, password)
23
24 def test_empty_pass(self):
25
26=== modified file 'bzrlib/transport/http/_pycurl.py'
27--- bzrlib/transport/http/_pycurl.py 2011-12-19 13:23:58 +0000
28+++ bzrlib/transport/http/_pycurl.py 2017-01-15 18:54:57 +0000
29@@ -85,6 +85,9 @@
30 """
31 return pycurl.__dict__.get(symbol, default)
32
33+# Yes, weird but returned on weird http error (invalid status line)
34+CURLE_FTP_WEIRD_SERVER_REPLY = _get_pycurl_errcode(
35+ 'E_FTP_WEIRD_SERVER_REPLY', 8)
36 CURLE_COULDNT_CONNECT = _get_pycurl_errcode('E_COULDNT_CONNECT', 7)
37 CURLE_COULDNT_RESOLVE_HOST = _get_pycurl_errcode('E_COULDNT_RESOLVE_HOST', 6)
38 CURLE_COULDNT_RESOLVE_PROXY = _get_pycurl_errcode('E_COULDNT_RESOLVE_PROXY', 5)
39@@ -397,6 +400,7 @@
40 if e[0] in (CURLE_COULDNT_RESOLVE_HOST,
41 CURLE_COULDNT_RESOLVE_PROXY,
42 CURLE_COULDNT_CONNECT,
43+ CURLE_FTP_WEIRD_SERVER_REPLY,
44 CURLE_GOT_NOTHING,
45 CURLE_SSL_CACERT,
46 CURLE_SSL_CACERT_BADFILE,
47
48=== modified file 'doc/en/release-notes/bzr-2.7.txt'
49--- doc/en/release-notes/bzr-2.7.txt 2017-01-15 18:18:01 +0000
50+++ doc/en/release-notes/bzr-2.7.txt 2017-01-15 18:54:57 +0000
51@@ -11,6 +11,22 @@
52 :2.7.1: NOT RELEASED YET
53
54
55+External Compatibility Breaks
56+*****************************
57+
58+None.
59+
60+New Features
61+************
62+
63+None.
64+
65+Improvements
66+************
67+
68+None.
69+
70+
71 Bug Fixes
72 *********
73
74@@ -22,6 +38,28 @@
75
76 * Clarify pypi uploads for releases. (Vincent Ladeuil, #1542903)
77
78+API Changes
79+***********
80+
81+None.
82+
83+Internals
84+*********
85+
86+None.
87+
88+Changed Behaviour
89+*****************
90+
91+None.
92+
93+Testing
94+*******
95+
96+* Recent versions of pycurl started being stricter about the proxy url,
97+ using 'http+pycurl:' is not allowed anymore and should just be 'http:'
98+ (Vincent Ladeuil, #1645017).
99+
100
101 bzr 2.7.0
102 #########

Subscribers

People subscribed via source and target branches