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

Proposed by Vincent Ladeuil
Status: Merged
Approved by: Vincent Ladeuil
Approved revision: no longer in the source branch.
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) Approve
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.
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

This should probably also go into bzr.dev

review: Approve
Revision history for this message
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
=== modified file 'bzrlib/tests/test_http.py'
--- bzrlib/tests/test_http.py 2016-09-09 12:59:40 +0000
+++ bzrlib/tests/test_http.py 2017-01-15 18:54:57 +0000
@@ -1283,6 +1283,8 @@
1283 self.no_proxy_host = self.server_host_port1283 self.no_proxy_host = self.server_host_port
1284 # The secondary server is the proxy1284 # The secondary server is the proxy
1285 self.proxy_url = self.get_secondary_url()1285 self.proxy_url = self.get_secondary_url()
1286 if self._testing_pycurl():
1287 self.proxy_url = self.proxy_url.replace('+pycurl', '')
12861288
1287 def _testing_pycurl(self):1289 def _testing_pycurl(self):
1288 # TODO: This is duplicated for lots of the classes in this file1290 # TODO: This is duplicated for lots of the classes in this file
@@ -1863,7 +1865,10 @@
1863 ])1865 ])
18641866
1865 def get_user_transport(self, user, password):1867 def get_user_transport(self, user, password):
1866 self.overrideEnv('all_proxy', self.get_user_url(user, password))1868 proxy_url = self.get_user_url(user, password)
1869 if self._testing_pycurl():
1870 proxy_url = proxy_url.replace('+pycurl', '')
1871 self.overrideEnv('all_proxy', proxy_url)
1867 return TestAuth.get_user_transport(self, user, password)1872 return TestAuth.get_user_transport(self, user, password)
18681873
1869 def test_empty_pass(self):1874 def test_empty_pass(self):
18701875
=== modified file 'bzrlib/transport/http/_pycurl.py'
--- bzrlib/transport/http/_pycurl.py 2011-12-19 13:23:58 +0000
+++ bzrlib/transport/http/_pycurl.py 2017-01-15 18:54:57 +0000
@@ -85,6 +85,9 @@
85 """85 """
86 return pycurl.__dict__.get(symbol, default)86 return pycurl.__dict__.get(symbol, default)
8787
88# Yes, weird but returned on weird http error (invalid status line)
89CURLE_FTP_WEIRD_SERVER_REPLY = _get_pycurl_errcode(
90 'E_FTP_WEIRD_SERVER_REPLY', 8)
88CURLE_COULDNT_CONNECT = _get_pycurl_errcode('E_COULDNT_CONNECT', 7)91CURLE_COULDNT_CONNECT = _get_pycurl_errcode('E_COULDNT_CONNECT', 7)
89CURLE_COULDNT_RESOLVE_HOST = _get_pycurl_errcode('E_COULDNT_RESOLVE_HOST', 6)92CURLE_COULDNT_RESOLVE_HOST = _get_pycurl_errcode('E_COULDNT_RESOLVE_HOST', 6)
90CURLE_COULDNT_RESOLVE_PROXY = _get_pycurl_errcode('E_COULDNT_RESOLVE_PROXY', 5)93CURLE_COULDNT_RESOLVE_PROXY = _get_pycurl_errcode('E_COULDNT_RESOLVE_PROXY', 5)
@@ -397,6 +400,7 @@
397 if e[0] in (CURLE_COULDNT_RESOLVE_HOST,400 if e[0] in (CURLE_COULDNT_RESOLVE_HOST,
398 CURLE_COULDNT_RESOLVE_PROXY,401 CURLE_COULDNT_RESOLVE_PROXY,
399 CURLE_COULDNT_CONNECT,402 CURLE_COULDNT_CONNECT,
403 CURLE_FTP_WEIRD_SERVER_REPLY,
400 CURLE_GOT_NOTHING,404 CURLE_GOT_NOTHING,
401 CURLE_SSL_CACERT,405 CURLE_SSL_CACERT,
402 CURLE_SSL_CACERT_BADFILE,406 CURLE_SSL_CACERT_BADFILE,
403407
=== modified file 'doc/en/release-notes/bzr-2.7.txt'
--- doc/en/release-notes/bzr-2.7.txt 2017-01-15 18:18:01 +0000
+++ doc/en/release-notes/bzr-2.7.txt 2017-01-15 18:54:57 +0000
@@ -11,6 +11,22 @@
11:2.7.1: NOT RELEASED YET11:2.7.1: NOT RELEASED YET
1212
1313
14External Compatibility Breaks
15*****************************
16
17None.
18
19New Features
20************
21
22None.
23
24Improvements
25************
26
27None.
28
29
14Bug Fixes30Bug Fixes
15*********31*********
1632
@@ -22,6 +38,28 @@
2238
23* Clarify pypi uploads for releases. (Vincent Ladeuil, #1542903)39* Clarify pypi uploads for releases. (Vincent Ladeuil, #1542903)
2440
41API Changes
42***********
43
44None.
45
46Internals
47*********
48
49None.
50
51Changed Behaviour
52*****************
53
54None.
55
56Testing
57*******
58
59* Recent versions of pycurl started being stricter about the proxy url,
60 using 'http+pycurl:' is not allowed anymore and should just be 'http:'
61 (Vincent Ladeuil, #1645017).
62
2563
26bzr 2.7.064bzr 2.7.0
27#########65#########

Subscribers

People subscribed via source and target branches