launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #21012
[Merge] lp:~wgrant/launchpad/xenial-fixes-1 into lp:launchpad
William Grant has proposed merging lp:~wgrant/launchpad/xenial-fixes-1 into lp:launchpad.
Commit message:
Various fixes for Python 2.7.12.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~wgrant/launchpad/xenial-fixes-1/+merge/306300
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.
--
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~wgrant/launchpad/xenial-fixes-1 into lp:launchpad.
=== modified file 'Makefile'
--- Makefile 2016-09-14 11:13:06 +0000
+++ Makefile 2016-09-21 04:32:55 +0000
@@ -1,8 +1,7 @@
# This file modified from Zope3/Makefile
# Licensed under the ZPL, (c) Zope Corporation and contributors.
-PYTHON:=$(shell sed -e \
- '/RELEASE/!d; s/.*=1[234].*/python2.7/; s/.*=.*/python2.6/' /etc/lsb-release)
+PYTHON:=python2.7
WD:=$(shell pwd)
PY=$(WD)/bin/py
=== 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 @@
the XML-RPC transport.
>>> test_transport.cookie_processor.cookiejar
- <cookielib.CookieJar[Cookie(version=0, name='Bugzilla_login'...),
- Cookie(version=0, name='Bugzilla_logincookie'...)]>
+ <...CookieJar[Cookie(version=0, name='Bugzilla_login'...),
+ Cookie(version=0, name='Bugzilla_logincookie'...)]>
Trying to log in to a Bugzilla instance for which we have no credentials
will raise an error:
=== 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 @@
the XML-RPC transport.
>>> test_transport.cookie_processor.cookiejar
- <cookielib.CookieJar[Cookie(version=0, name='Bugzilla_login'...),
- Cookie(version=0, name='Bugzilla_logincookie'...)]>
+ <...CookieJar[Cookie(version=0, name='Bugzilla_login'...),
+ Cookie(version=0, name='Bugzilla_logincookie'...)]>
The externalbugtracker.bugzilla module contains a decorator,
needs_authentication, which can be used to ensure that a
=== 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 @@
auth_cookie attribute set.
>>> test_transport.cookie_processor.cookiejar
- <cookielib.CookieJar[Cookie(version=0, name='trac_auth'...
+ <...CookieJar[Cookie(version=0, name='trac_auth'...
The XML-RPC transport's cookie_processor shares its cookiejar with the
TracLPPlugin instance. This is so that the TracLPPlugin can use the
@@ -104,7 +104,7 @@
So if we look in the TracLPPlugin's CookieJar we'll see the same cookie:
>>> trac._cookie_jar
- <cookielib.CookieJar[Cookie(version=0, name='trac_auth'...
+ <...CookieJar[Cookie(version=0, name='trac_auth'...
And altering the cookie in the TracLPPlugin's CookieJar will mean, of
course, that it's altered in the XML-RPC transport's CookieJar, too.
@@ -123,11 +123,11 @@
>>> trac._cookie_jar.set_cookie(new_cookie)
>>> trac._cookie_jar
- <cookielib.CookieJar[Cookie(version=0, name='trac_auth',
+ <...CookieJar[Cookie(version=0, name='trac_auth',
value='Look ma, a new cookie!'...>
>>> test_transport.cookie_processor.cookiejar
- <cookielib.CookieJar[Cookie(version=0, name='trac_auth',
+ <...CookieJar[Cookie(version=0, name='trac_auth',
value='Look ma, a new cookie!'...>
If authentication fails, a BugTrackerAuthenticationError will be raised.
=== 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 @@
The Bugzilla_logincookie will now have been set for the transport, too.
>>> print bugzilla_transport.cookie_processor.cookiejar
- <cookielib.CookieJar[<Cookie Bugzilla_login=...>,
+ <...CookieJar[<Cookie Bugzilla_login=...>,
<Cookie Bugzilla_logincookie=...>]>
Trying to log in with an incorrect username or password will result in
=== 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 @@
The login cookies are in the transport's cookie jar.
>>> print bugzilla_transport.cookie_processor.cookiejar
- <cookielib.CookieJar[<Cookie Bugzilla_login=...>,
+ <...CookieJar[<Cookie Bugzilla_login=...>,
<Cookie Bugzilla_logincookie=...>]>
=== 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 @@
Before sending the request, the transport's cookie jar is empty.
>>> transport.cookie_processor.cookiejar
- <cookielib.CookieJar[]>
+ <...CookieJar[]>
>>> request_body = """<?xml version="1.0"?>
... <methodCall>
@@ -51,13 +51,13 @@
contains the 'foo=bar' cookie sent by the server.
>>> transport.cookie_processor.cookiejar
- <cookielib.CookieJar[Cookie(version=0, name='foo', value='bar'...)]>
+ <...CookieJar[Cookie(version=0, name='foo', value='bar'...)]>
In addition to cookies sent by the server, we can set cookies locally.
>>> transport.setCookie('ding=dong')
>>> transport.cookie_processor.cookiejar
- <cookielib.CookieJar[Cookie(version=0, name='ding', value='dong'...),
+ <...CookieJar[Cookie(version=0, name='ding', value='dong'...),
Cookie(version=0, name='foo', value='bar'...)]>
If an error occurs trying to make the request, an
=== 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 @@
... to_addrs='test@xxxxxxxxxxxxx',
... subject=u'Subject',
... body=u'Content')
- '20...launchpad@...'
+ '...launchpad@...'
>>> simple_sendmail(
... from_addr='F\xf4\xf4 Bar <foo.bar@xxxxxxxxxxxxx>',
@@ -211,7 +211,7 @@
... to_addrs=u'test@xxxxxxxxxxxxx',
... subject=u'Subject',
... body=u'Content')
- '20...launchpad@...'
+ '...launchpad@...'
>>> simple_sendmail(
... from_addr='Foo Bar <foo.bar@xxxxxxxxxxxxx>',
=== 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 @@
The default implementation will use the IPlacelessAuthentication
utility to setup the request.
+ >>> import base64
>>> login(ANONYMOUS) # Get rid of the marker object in the interaction.
>>> foo_bar_auth = 'Basic %s' % (
- ... 'foo.bar@xxxxxxxxxxxxx:test'.encode('base64'))
+ ... base64.b64encode('foo.bar@xxxxxxxxxxxxx:test'))
>>> request, publication = get_request_and_publication(
... extra_environment=dict(HTTP_AUTHORIZATION=foo_bar_auth))
>>> principal = publication.getPrincipal(request)
=== 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 @@
def _make(self, login, pwd):
dict = {
'HTTP_AUTHORIZATION':
- 'Basic %s' % base64.encodestring('%s:%s' % (login, pwd))}
+ 'Basic %s' % base64.b64encode('%s:%s' % (login, pwd))}
request = TestRequest(**dict)
return getUtility(IPlacelessAuthUtility), request
=== 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 @@
Requests on these hosts also honor the standard Launchpad authorization
scheme (and don't require OAuth).
+ >>> import base64
>>> from lp.testing.pages import (
... LaunchpadWebServiceCaller)
>>> noauth_webservice = LaunchpadWebServiceCaller(
... domain='bugs.launchpad.dev')
- >>> sample_auth = 'Basic %s' % 'test@xxxxxxxxxxxxx:test'.encode('base64')
+ >>> sample_auth = 'Basic %s' % base64.b64encode('test@xxxxxxxxxxxxx:test')
>>> print noauth_webservice.get(
... 'http://bugs.launchpad.dev/api/devel/people/+me',
... headers={'Authorization': sample_auth})
=== 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 @@
build_id=self.build.build_cookie,
timestamp=timestamp)
auth_string = '{}:{}'.format(admin_username, secret).strip()
- auth_header = 'Basic ' + base64.encodestring(auth_string)
+ auth_header = 'Basic ' + base64.b64encode(auth_string)
data = json.dumps({'username': proxy_username})
result = yield getPage(
=== 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 @@
if auth:
# Unlike the higher level Zope test browser, we actually have to
# encode the basic auth information.
- userpass = base64.encodestring(auth)
+ userpass = base64.b64encode(auth)
self.addHeader('Authorization', 'Basic ' + userpass)
_live_browser_set.add(weakref.ref(self, self._refclose))
=== 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 @@
# Alphabetical, case-insensitive, please! :-)
ampoule = 0.2.0
-amqp = 1.4.6
+amqp = 1.4.9
amqplib = 1.0.2
anyjson = 0.3.3
argparse = 1.2.1
@@ -51,7 +51,7 @@
itsdangerous = 0.24
jsautobuild = 0.2
keyring = 0.6.2
-kombu = 3.0.26
+kombu = 3.0.30
launchpad-buildd = 136
launchpadlib = 1.10.4
lazr.authentication = 0.1.1
Follow ups