Merge lp:~wgrant/launchpad/xenial-fixes-1 into lp:launchpad

Proposed by William Grant
Status: Merged
Merged at revision: 18205
Proposed branch: lp:~wgrant/launchpad/xenial-fixes-1
Merge into: lp:launchpad
Diff against target: 251 lines (+25/-24)
14 files modified
Makefile (+1/-2)
lib/lp/bugs/doc/externalbugtracker-bugzilla-api.txt (+2/-2)
lib/lp/bugs/doc/externalbugtracker-bugzilla-lp-plugin.txt (+2/-2)
lib/lp/bugs/doc/externalbugtracker-trac-lp-plugin.txt (+4/-4)
lib/lp/bugs/tests/bugzilla-api-xmlrpc-transport.txt (+1/-1)
lib/lp/bugs/tests/bugzilla-xmlrpc-transport.txt (+1/-1)
lib/lp/bugs/tests/externalbugtracker-xmlrpc-transport.txt (+3/-3)
lib/lp/services/mail/doc/sending-mail.txt (+2/-2)
lib/lp/services/webapp/doc/webapp-publication.txt (+2/-1)
lib/lp/services/webapp/tests/test_authutility.py (+1/-1)
lib/lp/services/webservice/stories/xx-service.txt (+2/-1)
lib/lp/snappy/model/snapbuildbehaviour.py (+1/-1)
lib/lp/testing/browser.py (+1/-1)
versions.cfg (+2/-2)
To merge this branch: bzr merge lp:~wgrant/launchpad/xenial-fixes-1
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+306300@code.launchpad.net

Commit message

Various fixes for Python 2.7.12.

Description of the change

Various fixes for Python 2.7.12.

This resolves most of the Python compatibility issues with Xenial. There'll be separate branches for PostgreSQL 9.5, GnuPG 2 and modern apt.

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Makefile'
2--- Makefile 2016-09-14 11:13:06 +0000
3+++ Makefile 2016-09-21 04:32:55 +0000
4@@ -1,8 +1,7 @@
5 # This file modified from Zope3/Makefile
6 # Licensed under the ZPL, (c) Zope Corporation and contributors.
7
8-PYTHON:=$(shell sed -e \
9- '/RELEASE/!d; s/.*=1[234].*/python2.7/; s/.*=.*/python2.6/' /etc/lsb-release)
10+PYTHON:=python2.7
11
12 WD:=$(shell pwd)
13 PY=$(WD)/bin/py
14
15=== modified file 'lib/lp/bugs/doc/externalbugtracker-bugzilla-api.txt'
16--- lib/lp/bugs/doc/externalbugtracker-bugzilla-api.txt 2012-12-26 01:32:19 +0000
17+++ lib/lp/bugs/doc/externalbugtracker-bugzilla-api.txt 2016-09-21 04:32:55 +0000
18@@ -52,8 +52,8 @@
19 the XML-RPC transport.
20
21 >>> test_transport.cookie_processor.cookiejar
22- <cookielib.CookieJar[Cookie(version=0, name='Bugzilla_login'...),
23- Cookie(version=0, name='Bugzilla_logincookie'...)]>
24+ <...CookieJar[Cookie(version=0, name='Bugzilla_login'...),
25+ Cookie(version=0, name='Bugzilla_logincookie'...)]>
26
27 Trying to log in to a Bugzilla instance for which we have no credentials
28 will raise an error:
29
30=== modified file 'lib/lp/bugs/doc/externalbugtracker-bugzilla-lp-plugin.txt'
31--- lib/lp/bugs/doc/externalbugtracker-bugzilla-lp-plugin.txt 2016-07-04 17:08:29 +0000
32+++ lib/lp/bugs/doc/externalbugtracker-bugzilla-lp-plugin.txt 2016-09-21 04:32:55 +0000
33@@ -79,8 +79,8 @@
34 the XML-RPC transport.
35
36 >>> test_transport.cookie_processor.cookiejar
37- <cookielib.CookieJar[Cookie(version=0, name='Bugzilla_login'...),
38- Cookie(version=0, name='Bugzilla_logincookie'...)]>
39+ <...CookieJar[Cookie(version=0, name='Bugzilla_login'...),
40+ Cookie(version=0, name='Bugzilla_logincookie'...)]>
41
42 The externalbugtracker.bugzilla module contains a decorator,
43 needs_authentication, which can be used to ensure that a
44
45=== modified file 'lib/lp/bugs/doc/externalbugtracker-trac-lp-plugin.txt'
46--- lib/lp/bugs/doc/externalbugtracker-trac-lp-plugin.txt 2016-07-04 17:08:29 +0000
47+++ lib/lp/bugs/doc/externalbugtracker-trac-lp-plugin.txt 2016-09-21 04:32:55 +0000
48@@ -90,7 +90,7 @@
49 auth_cookie attribute set.
50
51 >>> test_transport.cookie_processor.cookiejar
52- <cookielib.CookieJar[Cookie(version=0, name='trac_auth'...
53+ <...CookieJar[Cookie(version=0, name='trac_auth'...
54
55 The XML-RPC transport's cookie_processor shares its cookiejar with the
56 TracLPPlugin instance. This is so that the TracLPPlugin can use the
57@@ -104,7 +104,7 @@
58 So if we look in the TracLPPlugin's CookieJar we'll see the same cookie:
59
60 >>> trac._cookie_jar
61- <cookielib.CookieJar[Cookie(version=0, name='trac_auth'...
62+ <...CookieJar[Cookie(version=0, name='trac_auth'...
63
64 And altering the cookie in the TracLPPlugin's CookieJar will mean, of
65 course, that it's altered in the XML-RPC transport's CookieJar, too.
66@@ -123,11 +123,11 @@
67 >>> trac._cookie_jar.set_cookie(new_cookie)
68
69 >>> trac._cookie_jar
70- <cookielib.CookieJar[Cookie(version=0, name='trac_auth',
71+ <...CookieJar[Cookie(version=0, name='trac_auth',
72 value='Look ma, a new cookie!'...>
73
74 >>> test_transport.cookie_processor.cookiejar
75- <cookielib.CookieJar[Cookie(version=0, name='trac_auth',
76+ <...CookieJar[Cookie(version=0, name='trac_auth',
77 value='Look ma, a new cookie!'...>
78
79 If authentication fails, a BugTrackerAuthenticationError will be raised.
80
81=== modified file 'lib/lp/bugs/tests/bugzilla-api-xmlrpc-transport.txt'
82--- lib/lp/bugs/tests/bugzilla-api-xmlrpc-transport.txt 2012-05-02 17:34:42 +0000
83+++ lib/lp/bugs/tests/bugzilla-api-xmlrpc-transport.txt 2016-09-21 04:32:55 +0000
84@@ -44,7 +44,7 @@
85 The Bugzilla_logincookie will now have been set for the transport, too.
86
87 >>> print bugzilla_transport.cookie_processor.cookiejar
88- <cookielib.CookieJar[<Cookie Bugzilla_login=...>,
89+ <...CookieJar[<Cookie Bugzilla_login=...>,
90 <Cookie Bugzilla_logincookie=...>]>
91
92 Trying to log in with an incorrect username or password will result in
93
94=== modified file 'lib/lp/bugs/tests/bugzilla-xmlrpc-transport.txt'
95--- lib/lp/bugs/tests/bugzilla-xmlrpc-transport.txt 2012-05-02 16:10:21 +0000
96+++ lib/lp/bugs/tests/bugzilla-xmlrpc-transport.txt 2016-09-21 04:32:55 +0000
97@@ -91,7 +91,7 @@
98 The login cookies are in the transport's cookie jar.
99
100 >>> print bugzilla_transport.cookie_processor.cookiejar
101- <cookielib.CookieJar[<Cookie Bugzilla_login=...>,
102+ <...CookieJar[<Cookie Bugzilla_login=...>,
103 <Cookie Bugzilla_logincookie=...>]>
104
105
106
107=== modified file 'lib/lp/bugs/tests/externalbugtracker-xmlrpc-transport.txt'
108--- lib/lp/bugs/tests/externalbugtracker-xmlrpc-transport.txt 2013-04-04 02:55:31 +0000
109+++ lib/lp/bugs/tests/externalbugtracker-xmlrpc-transport.txt 2016-09-21 04:32:55 +0000
110@@ -30,7 +30,7 @@
111 Before sending the request, the transport's cookie jar is empty.
112
113 >>> transport.cookie_processor.cookiejar
114- <cookielib.CookieJar[]>
115+ <...CookieJar[]>
116
117 >>> request_body = """<?xml version="1.0"?>
118 ... <methodCall>
119@@ -51,13 +51,13 @@
120 contains the 'foo=bar' cookie sent by the server.
121
122 >>> transport.cookie_processor.cookiejar
123- <cookielib.CookieJar[Cookie(version=0, name='foo', value='bar'...)]>
124+ <...CookieJar[Cookie(version=0, name='foo', value='bar'...)]>
125
126 In addition to cookies sent by the server, we can set cookies locally.
127
128 >>> transport.setCookie('ding=dong')
129 >>> transport.cookie_processor.cookiejar
130- <cookielib.CookieJar[Cookie(version=0, name='ding', value='dong'...),
131+ <...CookieJar[Cookie(version=0, name='ding', value='dong'...),
132 Cookie(version=0, name='foo', value='bar'...)]>
133
134 If an error occurs trying to make the request, an
135
136=== modified file 'lib/lp/services/mail/doc/sending-mail.txt'
137--- lib/lp/services/mail/doc/sending-mail.txt 2015-10-01 10:25:19 +0000
138+++ lib/lp/services/mail/doc/sending-mail.txt 2016-09-21 04:32:55 +0000
139@@ -194,7 +194,7 @@
140 ... to_addrs='test@canonical.com',
141 ... subject=u'Subject',
142 ... body=u'Content')
143- '20...launchpad@...'
144+ '...launchpad@...'
145
146 >>> simple_sendmail(
147 ... from_addr='F\xf4\xf4 Bar <foo.bar@canonical.com>',
148@@ -211,7 +211,7 @@
149 ... to_addrs=u'test@canonical.com',
150 ... subject=u'Subject',
151 ... body=u'Content')
152- '20...launchpad@...'
153+ '...launchpad@...'
154
155 >>> simple_sendmail(
156 ... from_addr='Foo Bar <foo.bar@canonical.com>',
157
158=== modified file 'lib/lp/services/webapp/doc/webapp-publication.txt'
159--- lib/lp/services/webapp/doc/webapp-publication.txt 2016-02-28 19:13:17 +0000
160+++ lib/lp/services/webapp/doc/webapp-publication.txt 2016-09-21 04:32:55 +0000
161@@ -1034,9 +1034,10 @@
162 The default implementation will use the IPlacelessAuthentication
163 utility to setup the request.
164
165+ >>> import base64
166 >>> login(ANONYMOUS) # Get rid of the marker object in the interaction.
167 >>> foo_bar_auth = 'Basic %s' % (
168- ... 'foo.bar@canonical.com:test'.encode('base64'))
169+ ... base64.b64encode('foo.bar@canonical.com:test'))
170 >>> request, publication = get_request_and_publication(
171 ... extra_environment=dict(HTTP_AUTHORIZATION=foo_bar_auth))
172 >>> principal = publication.getPrincipal(request)
173
174=== modified file 'lib/lp/services/webapp/tests/test_authutility.py'
175--- lib/lp/services/webapp/tests/test_authutility.py 2015-07-08 16:05:11 +0000
176+++ lib/lp/services/webapp/tests/test_authutility.py 2016-09-21 04:32:55 +0000
177@@ -77,7 +77,7 @@
178 def _make(self, login, pwd):
179 dict = {
180 'HTTP_AUTHORIZATION':
181- 'Basic %s' % base64.encodestring('%s:%s' % (login, pwd))}
182+ 'Basic %s' % base64.b64encode('%s:%s' % (login, pwd))}
183 request = TestRequest(**dict)
184 return getUtility(IPlacelessAuthUtility), request
185
186
187=== modified file 'lib/lp/services/webservice/stories/xx-service.txt'
188--- lib/lp/services/webservice/stories/xx-service.txt 2016-01-26 15:14:01 +0000
189+++ lib/lp/services/webservice/stories/xx-service.txt 2016-09-21 04:32:55 +0000
190@@ -186,11 +186,12 @@
191 Requests on these hosts also honor the standard Launchpad authorization
192 scheme (and don't require OAuth).
193
194+ >>> import base64
195 >>> from lp.testing.pages import (
196 ... LaunchpadWebServiceCaller)
197 >>> noauth_webservice = LaunchpadWebServiceCaller(
198 ... domain='bugs.launchpad.dev')
199- >>> sample_auth = 'Basic %s' % 'test@canonical.com:test'.encode('base64')
200+ >>> sample_auth = 'Basic %s' % base64.b64encode('test@canonical.com:test')
201 >>> print noauth_webservice.get(
202 ... 'http://bugs.launchpad.dev/api/devel/people/+me',
203 ... headers={'Authorization': sample_auth})
204
205=== modified file 'lib/lp/snappy/model/snapbuildbehaviour.py'
206--- lib/lp/snappy/model/snapbuildbehaviour.py 2016-02-09 02:26:46 +0000
207+++ lib/lp/snappy/model/snapbuildbehaviour.py 2016-09-21 04:32:55 +0000
208@@ -126,7 +126,7 @@
209 build_id=self.build.build_cookie,
210 timestamp=timestamp)
211 auth_string = '{}:{}'.format(admin_username, secret).strip()
212- auth_header = 'Basic ' + base64.encodestring(auth_string)
213+ auth_header = 'Basic ' + base64.b64encode(auth_string)
214 data = json.dumps({'username': proxy_username})
215
216 result = yield getPage(
217
218=== modified file 'lib/lp/testing/browser.py'
219--- lib/lp/testing/browser.py 2013-09-27 04:13:23 +0000
220+++ lib/lp/testing/browser.py 2016-09-21 04:32:55 +0000
221@@ -79,7 +79,7 @@
222 if auth:
223 # Unlike the higher level Zope test browser, we actually have to
224 # encode the basic auth information.
225- userpass = base64.encodestring(auth)
226+ userpass = base64.b64encode(auth)
227 self.addHeader('Authorization', 'Basic ' + userpass)
228 _live_browser_set.add(weakref.ref(self, self._refclose))
229
230
231=== modified file 'versions.cfg'
232--- versions.cfg 2016-07-13 08:49:37 +0000
233+++ versions.cfg 2016-09-21 04:32:55 +0000
234@@ -8,7 +8,7 @@
235 # Alphabetical, case-insensitive, please! :-)
236
237 ampoule = 0.2.0
238-amqp = 1.4.6
239+amqp = 1.4.9
240 amqplib = 1.0.2
241 anyjson = 0.3.3
242 argparse = 1.2.1
243@@ -51,7 +51,7 @@
244 itsdangerous = 0.24
245 jsautobuild = 0.2
246 keyring = 0.6.2
247-kombu = 3.0.26
248+kombu = 3.0.30
249 launchpad-buildd = 136
250 launchpadlib = 1.10.4
251 lazr.authentication = 0.1.1