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
=== modified file 'Makefile'
--- Makefile 2016-09-14 11:13:06 +0000
+++ Makefile 2016-09-21 04:32:55 +0000
@@ -1,8 +1,7 @@
1# This file modified from Zope3/Makefile1# This file modified from Zope3/Makefile
2# Licensed under the ZPL, (c) Zope Corporation and contributors.2# Licensed under the ZPL, (c) Zope Corporation and contributors.
33
4PYTHON:=$(shell sed -e \4PYTHON:=python2.7
5 '/RELEASE/!d; s/.*=1[234].*/python2.7/; s/.*=.*/python2.6/' /etc/lsb-release)
65
7WD:=$(shell pwd)6WD:=$(shell pwd)
8PY=$(WD)/bin/py7PY=$(WD)/bin/py
98
=== modified file 'lib/lp/bugs/doc/externalbugtracker-bugzilla-api.txt'
--- lib/lp/bugs/doc/externalbugtracker-bugzilla-api.txt 2012-12-26 01:32:19 +0000
+++ lib/lp/bugs/doc/externalbugtracker-bugzilla-api.txt 2016-09-21 04:32:55 +0000
@@ -52,8 +52,8 @@
52the XML-RPC transport.52the XML-RPC transport.
5353
54 >>> test_transport.cookie_processor.cookiejar54 >>> test_transport.cookie_processor.cookiejar
55 <cookielib.CookieJar[Cookie(version=0, name='Bugzilla_login'...),55 <...CookieJar[Cookie(version=0, name='Bugzilla_login'...),
56 Cookie(version=0, name='Bugzilla_logincookie'...)]>56 Cookie(version=0, name='Bugzilla_logincookie'...)]>
5757
58Trying to log in to a Bugzilla instance for which we have no credentials58Trying to log in to a Bugzilla instance for which we have no credentials
59will raise an error:59will raise an error:
6060
=== modified file 'lib/lp/bugs/doc/externalbugtracker-bugzilla-lp-plugin.txt'
--- lib/lp/bugs/doc/externalbugtracker-bugzilla-lp-plugin.txt 2016-07-04 17:08:29 +0000
+++ lib/lp/bugs/doc/externalbugtracker-bugzilla-lp-plugin.txt 2016-09-21 04:32:55 +0000
@@ -79,8 +79,8 @@
79the XML-RPC transport.79the XML-RPC transport.
8080
81 >>> test_transport.cookie_processor.cookiejar81 >>> test_transport.cookie_processor.cookiejar
82 <cookielib.CookieJar[Cookie(version=0, name='Bugzilla_login'...),82 <...CookieJar[Cookie(version=0, name='Bugzilla_login'...),
83 Cookie(version=0, name='Bugzilla_logincookie'...)]>83 Cookie(version=0, name='Bugzilla_logincookie'...)]>
8484
85The externalbugtracker.bugzilla module contains a decorator,85The externalbugtracker.bugzilla module contains a decorator,
86needs_authentication, which can be used to ensure that a86needs_authentication, which can be used to ensure that a
8787
=== modified file 'lib/lp/bugs/doc/externalbugtracker-trac-lp-plugin.txt'
--- lib/lp/bugs/doc/externalbugtracker-trac-lp-plugin.txt 2016-07-04 17:08:29 +0000
+++ lib/lp/bugs/doc/externalbugtracker-trac-lp-plugin.txt 2016-09-21 04:32:55 +0000
@@ -90,7 +90,7 @@
90auth_cookie attribute set.90auth_cookie attribute set.
9191
92 >>> test_transport.cookie_processor.cookiejar92 >>> test_transport.cookie_processor.cookiejar
93 <cookielib.CookieJar[Cookie(version=0, name='trac_auth'...93 <...CookieJar[Cookie(version=0, name='trac_auth'...
9494
95The XML-RPC transport's cookie_processor shares its cookiejar with the95The XML-RPC transport's cookie_processor shares its cookiejar with the
96TracLPPlugin instance. This is so that the TracLPPlugin can use the96TracLPPlugin instance. This is so that the TracLPPlugin can use the
@@ -104,7 +104,7 @@
104So if we look in the TracLPPlugin's CookieJar we'll see the same cookie:104So if we look in the TracLPPlugin's CookieJar we'll see the same cookie:
105105
106 >>> trac._cookie_jar106 >>> trac._cookie_jar
107 <cookielib.CookieJar[Cookie(version=0, name='trac_auth'...107 <...CookieJar[Cookie(version=0, name='trac_auth'...
108108
109And altering the cookie in the TracLPPlugin's CookieJar will mean, of109And altering the cookie in the TracLPPlugin's CookieJar will mean, of
110course, that it's altered in the XML-RPC transport's CookieJar, too.110course, that it's altered in the XML-RPC transport's CookieJar, too.
@@ -123,11 +123,11 @@
123 >>> trac._cookie_jar.set_cookie(new_cookie)123 >>> trac._cookie_jar.set_cookie(new_cookie)
124124
125 >>> trac._cookie_jar125 >>> trac._cookie_jar
126 <cookielib.CookieJar[Cookie(version=0, name='trac_auth',126 <...CookieJar[Cookie(version=0, name='trac_auth',
127 value='Look ma, a new cookie!'...>127 value='Look ma, a new cookie!'...>
128128
129 >>> test_transport.cookie_processor.cookiejar129 >>> test_transport.cookie_processor.cookiejar
130 <cookielib.CookieJar[Cookie(version=0, name='trac_auth',130 <...CookieJar[Cookie(version=0, name='trac_auth',
131 value='Look ma, a new cookie!'...>131 value='Look ma, a new cookie!'...>
132132
133If authentication fails, a BugTrackerAuthenticationError will be raised.133If authentication fails, a BugTrackerAuthenticationError will be raised.
134134
=== modified file 'lib/lp/bugs/tests/bugzilla-api-xmlrpc-transport.txt'
--- lib/lp/bugs/tests/bugzilla-api-xmlrpc-transport.txt 2012-05-02 17:34:42 +0000
+++ lib/lp/bugs/tests/bugzilla-api-xmlrpc-transport.txt 2016-09-21 04:32:55 +0000
@@ -44,7 +44,7 @@
44The Bugzilla_logincookie will now have been set for the transport, too.44The Bugzilla_logincookie will now have been set for the transport, too.
4545
46 >>> print bugzilla_transport.cookie_processor.cookiejar46 >>> print bugzilla_transport.cookie_processor.cookiejar
47 <cookielib.CookieJar[<Cookie Bugzilla_login=...>,47 <...CookieJar[<Cookie Bugzilla_login=...>,
48 <Cookie Bugzilla_logincookie=...>]>48 <Cookie Bugzilla_logincookie=...>]>
4949
50Trying to log in with an incorrect username or password will result in50Trying to log in with an incorrect username or password will result in
5151
=== modified file 'lib/lp/bugs/tests/bugzilla-xmlrpc-transport.txt'
--- lib/lp/bugs/tests/bugzilla-xmlrpc-transport.txt 2012-05-02 16:10:21 +0000
+++ lib/lp/bugs/tests/bugzilla-xmlrpc-transport.txt 2016-09-21 04:32:55 +0000
@@ -91,7 +91,7 @@
91The login cookies are in the transport's cookie jar.91The login cookies are in the transport's cookie jar.
9292
93 >>> print bugzilla_transport.cookie_processor.cookiejar93 >>> print bugzilla_transport.cookie_processor.cookiejar
94 <cookielib.CookieJar[<Cookie Bugzilla_login=...>,94 <...CookieJar[<Cookie Bugzilla_login=...>,
95 <Cookie Bugzilla_logincookie=...>]>95 <Cookie Bugzilla_logincookie=...>]>
9696
9797
9898
=== modified file 'lib/lp/bugs/tests/externalbugtracker-xmlrpc-transport.txt'
--- lib/lp/bugs/tests/externalbugtracker-xmlrpc-transport.txt 2013-04-04 02:55:31 +0000
+++ lib/lp/bugs/tests/externalbugtracker-xmlrpc-transport.txt 2016-09-21 04:32:55 +0000
@@ -30,7 +30,7 @@
30Before sending the request, the transport's cookie jar is empty.30Before sending the request, the transport's cookie jar is empty.
3131
32 >>> transport.cookie_processor.cookiejar32 >>> transport.cookie_processor.cookiejar
33 <cookielib.CookieJar[]>33 <...CookieJar[]>
3434
35 >>> request_body = """<?xml version="1.0"?>35 >>> request_body = """<?xml version="1.0"?>
36 ... <methodCall>36 ... <methodCall>
@@ -51,13 +51,13 @@
51contains the 'foo=bar' cookie sent by the server.51contains the 'foo=bar' cookie sent by the server.
5252
53 >>> transport.cookie_processor.cookiejar53 >>> transport.cookie_processor.cookiejar
54 <cookielib.CookieJar[Cookie(version=0, name='foo', value='bar'...)]>54 <...CookieJar[Cookie(version=0, name='foo', value='bar'...)]>
5555
56In addition to cookies sent by the server, we can set cookies locally.56In addition to cookies sent by the server, we can set cookies locally.
5757
58 >>> transport.setCookie('ding=dong')58 >>> transport.setCookie('ding=dong')
59 >>> transport.cookie_processor.cookiejar59 >>> transport.cookie_processor.cookiejar
60 <cookielib.CookieJar[Cookie(version=0, name='ding', value='dong'...),60 <...CookieJar[Cookie(version=0, name='ding', value='dong'...),
61 Cookie(version=0, name='foo', value='bar'...)]>61 Cookie(version=0, name='foo', value='bar'...)]>
6262
63If an error occurs trying to make the request, an63If an error occurs trying to make the request, an
6464
=== modified file 'lib/lp/services/mail/doc/sending-mail.txt'
--- lib/lp/services/mail/doc/sending-mail.txt 2015-10-01 10:25:19 +0000
+++ lib/lp/services/mail/doc/sending-mail.txt 2016-09-21 04:32:55 +0000
@@ -194,7 +194,7 @@
194 ... to_addrs='test@canonical.com',194 ... to_addrs='test@canonical.com',
195 ... subject=u'Subject',195 ... subject=u'Subject',
196 ... body=u'Content')196 ... body=u'Content')
197 '20...launchpad@...'197 '...launchpad@...'
198198
199 >>> simple_sendmail(199 >>> simple_sendmail(
200 ... from_addr='F\xf4\xf4 Bar <foo.bar@canonical.com>',200 ... from_addr='F\xf4\xf4 Bar <foo.bar@canonical.com>',
@@ -211,7 +211,7 @@
211 ... to_addrs=u'test@canonical.com',211 ... to_addrs=u'test@canonical.com',
212 ... subject=u'Subject',212 ... subject=u'Subject',
213 ... body=u'Content')213 ... body=u'Content')
214 '20...launchpad@...'214 '...launchpad@...'
215215
216 >>> simple_sendmail(216 >>> simple_sendmail(
217 ... from_addr='Foo Bar <foo.bar@canonical.com>',217 ... from_addr='Foo Bar <foo.bar@canonical.com>',
218218
=== modified file 'lib/lp/services/webapp/doc/webapp-publication.txt'
--- lib/lp/services/webapp/doc/webapp-publication.txt 2016-02-28 19:13:17 +0000
+++ lib/lp/services/webapp/doc/webapp-publication.txt 2016-09-21 04:32:55 +0000
@@ -1034,9 +1034,10 @@
1034The default implementation will use the IPlacelessAuthentication1034The default implementation will use the IPlacelessAuthentication
1035utility to setup the request.1035utility to setup the request.
10361036
1037 >>> import base64
1037 >>> login(ANONYMOUS) # Get rid of the marker object in the interaction.1038 >>> login(ANONYMOUS) # Get rid of the marker object in the interaction.
1038 >>> foo_bar_auth = 'Basic %s' % (1039 >>> foo_bar_auth = 'Basic %s' % (
1039 ... 'foo.bar@canonical.com:test'.encode('base64'))1040 ... base64.b64encode('foo.bar@canonical.com:test'))
1040 >>> request, publication = get_request_and_publication(1041 >>> request, publication = get_request_and_publication(
1041 ... extra_environment=dict(HTTP_AUTHORIZATION=foo_bar_auth))1042 ... extra_environment=dict(HTTP_AUTHORIZATION=foo_bar_auth))
1042 >>> principal = publication.getPrincipal(request)1043 >>> principal = publication.getPrincipal(request)
10431044
=== modified file 'lib/lp/services/webapp/tests/test_authutility.py'
--- lib/lp/services/webapp/tests/test_authutility.py 2015-07-08 16:05:11 +0000
+++ lib/lp/services/webapp/tests/test_authutility.py 2016-09-21 04:32:55 +0000
@@ -77,7 +77,7 @@
77 def _make(self, login, pwd):77 def _make(self, login, pwd):
78 dict = {78 dict = {
79 'HTTP_AUTHORIZATION':79 'HTTP_AUTHORIZATION':
80 'Basic %s' % base64.encodestring('%s:%s' % (login, pwd))}80 'Basic %s' % base64.b64encode('%s:%s' % (login, pwd))}
81 request = TestRequest(**dict)81 request = TestRequest(**dict)
82 return getUtility(IPlacelessAuthUtility), request82 return getUtility(IPlacelessAuthUtility), request
8383
8484
=== modified file 'lib/lp/services/webservice/stories/xx-service.txt'
--- lib/lp/services/webservice/stories/xx-service.txt 2016-01-26 15:14:01 +0000
+++ lib/lp/services/webservice/stories/xx-service.txt 2016-09-21 04:32:55 +0000
@@ -186,11 +186,12 @@
186Requests on these hosts also honor the standard Launchpad authorization186Requests on these hosts also honor the standard Launchpad authorization
187scheme (and don't require OAuth).187scheme (and don't require OAuth).
188188
189 >>> import base64
189 >>> from lp.testing.pages import (190 >>> from lp.testing.pages import (
190 ... LaunchpadWebServiceCaller)191 ... LaunchpadWebServiceCaller)
191 >>> noauth_webservice = LaunchpadWebServiceCaller(192 >>> noauth_webservice = LaunchpadWebServiceCaller(
192 ... domain='bugs.launchpad.dev')193 ... domain='bugs.launchpad.dev')
193 >>> sample_auth = 'Basic %s' % 'test@canonical.com:test'.encode('base64')194 >>> sample_auth = 'Basic %s' % base64.b64encode('test@canonical.com:test')
194 >>> print noauth_webservice.get(195 >>> print noauth_webservice.get(
195 ... 'http://bugs.launchpad.dev/api/devel/people/+me',196 ... 'http://bugs.launchpad.dev/api/devel/people/+me',
196 ... headers={'Authorization': sample_auth})197 ... headers={'Authorization': sample_auth})
197198
=== modified file 'lib/lp/snappy/model/snapbuildbehaviour.py'
--- lib/lp/snappy/model/snapbuildbehaviour.py 2016-02-09 02:26:46 +0000
+++ lib/lp/snappy/model/snapbuildbehaviour.py 2016-09-21 04:32:55 +0000
@@ -126,7 +126,7 @@
126 build_id=self.build.build_cookie,126 build_id=self.build.build_cookie,
127 timestamp=timestamp)127 timestamp=timestamp)
128 auth_string = '{}:{}'.format(admin_username, secret).strip()128 auth_string = '{}:{}'.format(admin_username, secret).strip()
129 auth_header = 'Basic ' + base64.encodestring(auth_string)129 auth_header = 'Basic ' + base64.b64encode(auth_string)
130 data = json.dumps({'username': proxy_username})130 data = json.dumps({'username': proxy_username})
131131
132 result = yield getPage(132 result = yield getPage(
133133
=== modified file 'lib/lp/testing/browser.py'
--- lib/lp/testing/browser.py 2013-09-27 04:13:23 +0000
+++ lib/lp/testing/browser.py 2016-09-21 04:32:55 +0000
@@ -79,7 +79,7 @@
79 if auth:79 if auth:
80 # Unlike the higher level Zope test browser, we actually have to80 # Unlike the higher level Zope test browser, we actually have to
81 # encode the basic auth information.81 # encode the basic auth information.
82 userpass = base64.encodestring(auth)82 userpass = base64.b64encode(auth)
83 self.addHeader('Authorization', 'Basic ' + userpass)83 self.addHeader('Authorization', 'Basic ' + userpass)
84 _live_browser_set.add(weakref.ref(self, self._refclose))84 _live_browser_set.add(weakref.ref(self, self._refclose))
8585
8686
=== modified file 'versions.cfg'
--- versions.cfg 2016-07-13 08:49:37 +0000
+++ versions.cfg 2016-09-21 04:32:55 +0000
@@ -8,7 +8,7 @@
8# Alphabetical, case-insensitive, please! :-)8# Alphabetical, case-insensitive, please! :-)
99
10ampoule = 0.2.010ampoule = 0.2.0
11amqp = 1.4.611amqp = 1.4.9
12amqplib = 1.0.212amqplib = 1.0.2
13anyjson = 0.3.313anyjson = 0.3.3
14argparse = 1.2.114argparse = 1.2.1
@@ -51,7 +51,7 @@
51itsdangerous = 0.2451itsdangerous = 0.24
52jsautobuild = 0.252jsautobuild = 0.2
53keyring = 0.6.253keyring = 0.6.2
54kombu = 3.0.2654kombu = 3.0.30
55launchpad-buildd = 13655launchpad-buildd = 136
56launchpadlib = 1.10.456launchpadlib = 1.10.4
57lazr.authentication = 0.1.157lazr.authentication = 0.1.1