Merge ~cjwatson/launchpad:python-openid2 into launchpad:master
- Git
- lp:~cjwatson/launchpad
- python-openid2
- Merge into master
Status: | Merged |
---|---|
Approved by: | Colin Watson |
Approved revision: | ac8b30ac3de0fcfc1f69b82926f76e77083655b5 |
Merge reported by: | Otto Co-Pilot |
Merged at revision: | not available |
Proposed branch: | ~cjwatson/launchpad:python-openid2 |
Merge into: | launchpad:master |
Diff against target: |
342 lines (+38/-53) 15 files modified
constraints.txt (+1/-4) lib/launchpad_loggerhead/app.py (+1/-5) lib/launchpad_loggerhead/wsgi.py (+0/-5) lib/lp/scripts/utilities/test.py (+0/-18) lib/lp/services/openid/browser/openiddiscovery.py (+4/-2) lib/lp/services/openid/extensions/macaroon.py (+6/-2) lib/lp/services/openid/extensions/tests/test_macaroon.py (+2/-0) lib/lp/services/openid/fetcher.py (+13/-1) lib/lp/services/webapp/login.py (+0/-4) lib/lp/testopenid/browser/server.py (+1/-7) lib/lp/testopenid/interfaces/server.py (+3/-1) lib/lp/testopenid/stories/basics.txt (+1/-1) lib/lp/testopenid/testing/helpers.py (+3/-2) lib/lp_sitecustomize.py (+2/-0) setup.py (+1/-1) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Thiago F. Pappacena (community) | Approve | ||
Review via email: mp+387907@code.launchpad.net |
Commit message
Upgrade to python-openid2 3.2
Description of the change
This adds Python 3 support.
Our fork is no longer needed, because as of e6d54f6311 we force the OpenID fetcher to Urllib2Fetcher in loggerhead as well as in lp.services.
I've removed several patches for problems with python-openid that have been fixed in python-openid2.
Dependencies MP: https:/
- ac8b30a... by Colin Watson
-
Upgrade to python-openid2 3.2
This adds Python 3 support.
Our fork is no longer needed, because as of e6d54f6311 we force the
OpenID fetcher to Urllib2Fetcher in loggerhead as well as in
lp.services.webapp. login, and the fork was only ever needed to fix
CurlFetcher.I've removed several patches for problems with python-openid that have
been fixed in python-openid2.
Preview Diff
1 | diff --git a/constraints.txt b/constraints.txt | |||
2 | index 706f7da..00eecfa 100644 | |||
3 | --- a/constraints.txt | |||
4 | +++ b/constraints.txt | |||
5 | @@ -278,10 +278,7 @@ python-dateutil==2.8.1 | |||
6 | 278 | python-debian==0.1.32 | 278 | python-debian==0.1.32 |
7 | 279 | python-keystoneclient==0.7.1 | 279 | python-keystoneclient==0.7.1 |
8 | 280 | python-memcached==1.58 | 280 | python-memcached==1.58 |
13 | 281 | # XXX: deryck 2012-08-10 | 281 | python-openid2==3.2 |
10 | 282 | # See lp:~deryck/python-openid/python-openid-fix1034376 which | ||
11 | 283 | # reapplied a patch from wgrant to get codehosting going again. | ||
12 | 284 | python-openid==2.2.5-fix1034376 | ||
14 | 285 | python-swiftclient==2.0.3 | 282 | python-swiftclient==2.0.3 |
15 | 286 | PyYAML==3.10 | 283 | PyYAML==3.10 |
16 | 287 | rabbitfixture==0.4.2 | 284 | rabbitfixture==0.4.2 |
17 | diff --git a/lib/launchpad_loggerhead/app.py b/lib/launchpad_loggerhead/app.py | |||
18 | index a671d73..d6a653b 100644 | |||
19 | --- a/lib/launchpad_loggerhead/app.py | |||
20 | +++ b/lib/launchpad_loggerhead/app.py | |||
21 | @@ -53,7 +53,6 @@ from lp.code.interfaces.codehosting import ( | |||
22 | 53 | from lp.codehosting.vfs import get_lp_server | 53 | from lp.codehosting.vfs import get_lp_server |
23 | 54 | from lp.services.config import config | 54 | from lp.services.config import config |
24 | 55 | from lp.services.webapp.errorlog import ErrorReportingUtility | 55 | from lp.services.webapp.errorlog import ErrorReportingUtility |
25 | 56 | from lp.services.webapp.openid import set_default_openid_fetcher | ||
26 | 57 | from lp.services.webapp.vhosts import allvhosts | 56 | from lp.services.webapp.vhosts import allvhosts |
27 | 58 | from lp.xmlrpc import faults | 57 | from lp.xmlrpc import faults |
28 | 59 | 58 | ||
29 | @@ -69,9 +68,6 @@ robots_app = DataApp(robots_txt, content_type='text/plain') | |||
30 | 69 | thread_locals = threading.local() | 68 | thread_locals = threading.local() |
31 | 70 | 69 | ||
32 | 71 | 70 | ||
33 | 72 | set_default_openid_fetcher() | ||
34 | 73 | |||
35 | 74 | |||
36 | 75 | def check_fault(fault, *fault_classes): | 71 | def check_fault(fault, *fault_classes): |
37 | 76 | """Check if 'fault's faultCode matches any of 'fault_classes'. | 72 | """Check if 'fault's faultCode matches any of 'fault_classes'. |
38 | 77 | 73 | ||
39 | @@ -124,7 +120,7 @@ class RootApp: | |||
40 | 124 | openid_request = self._make_consumer(environ).begin( | 120 | openid_request = self._make_consumer(environ).begin( |
41 | 125 | config.launchpad.openid_provider_root) | 121 | config.launchpad.openid_provider_root) |
42 | 126 | openid_request.addExtension( | 122 | openid_request.addExtension( |
44 | 127 | SRegRequest(required=['nickname'])) | 123 | SRegRequest(required=[u'nickname'])) |
45 | 128 | back_to = construct_url(environ) | 124 | back_to = construct_url(environ) |
46 | 129 | raise HTTPMovedPermanently(openid_request.redirectURL( | 125 | raise HTTPMovedPermanently(openid_request.redirectURL( |
47 | 130 | config.codehosting.secure_codebrowse_root, | 126 | config.codehosting.secure_codebrowse_root, |
48 | diff --git a/lib/launchpad_loggerhead/wsgi.py b/lib/launchpad_loggerhead/wsgi.py | |||
49 | index 6002448..be5601b 100644 | |||
50 | --- a/lib/launchpad_loggerhead/wsgi.py | |||
51 | +++ b/lib/launchpad_loggerhead/wsgi.py | |||
52 | @@ -19,7 +19,6 @@ import traceback | |||
53 | 19 | 19 | ||
54 | 20 | from gunicorn.app.base import Application | 20 | from gunicorn.app.base import Application |
55 | 21 | from gunicorn.glogging import Logger | 21 | from gunicorn.glogging import Logger |
56 | 22 | from openid import oidutil | ||
57 | 23 | from paste.deploy.config import PrefixMiddleware | 22 | from paste.deploy.config import PrefixMiddleware |
58 | 24 | from paste.httpexceptions import HTTPExceptionHandler | 23 | from paste.httpexceptions import HTTPExceptionHandler |
59 | 25 | from paste.request import construct_url | 24 | from paste.request import construct_url |
60 | @@ -89,10 +88,6 @@ class LoggerheadLogger(Logger): | |||
61 | 89 | ['-q', '--ms', '--log-file=DEBUG:%s' % cfg.errorlog]) | 88 | ['-q', '--ms', '--log-file=DEBUG:%s' % cfg.errorlog]) |
62 | 90 | logger(log_options) | 89 | logger(log_options) |
63 | 91 | 90 | ||
64 | 92 | # Make the OpenID library use proper logging rather than writing to | ||
65 | 93 | # stderr. | ||
66 | 94 | oidutil.log = lambda message, level=0: log.debug(message) | ||
67 | 95 | |||
68 | 96 | 91 | ||
69 | 97 | def _on_starting_hook(arbiter): | 92 | def _on_starting_hook(arbiter): |
70 | 98 | # Normally lp.services.pidfile.make_pidfile does this, but in this case | 93 | # Normally lp.services.pidfile.make_pidfile does this, but in this case |
71 | diff --git a/lib/lp/scripts/utilities/test.py b/lib/lp/scripts/utilities/test.py | |||
72 | index 208c764..167d5c4 100755 | |||
73 | --- a/lib/lp/scripts/utilities/test.py | |||
74 | +++ b/lib/lp/scripts/utilities/test.py | |||
75 | @@ -106,24 +106,6 @@ def filter_warnings(): | |||
76 | 106 | warnings.filterwarnings( | 106 | warnings.filterwarnings( |
77 | 107 | 'ignore', 'bzrlib.*was deprecated', DeprecationWarning, | 107 | 'ignore', 'bzrlib.*was deprecated', DeprecationWarning, |
78 | 108 | ) | 108 | ) |
79 | 109 | # The next one is caused by an infelicity in python-openid. The | ||
80 | 110 | # following change to openid/server/server.py would make the warning | ||
81 | 111 | # filter unnecessary: | ||
82 | 112 | # 978c974,974 | ||
83 | 113 | # > try: | ||
84 | 114 | # > namespace = request.message.getOpenIDNamespace() | ||
85 | 115 | # > except AttributeError: | ||
86 | 116 | # > namespace = request.namespace | ||
87 | 117 | # > self.fields = Message(namespace) | ||
88 | 118 | # --- | ||
89 | 119 | # < self.fields = Message(request.namespace) | ||
90 | 120 | warnings.filterwarnings( | ||
91 | 121 | 'ignore', | ||
92 | 122 | (r'The \"namespace\" attribute of CheckIDRequest objects is ' | ||
93 | 123 | r'deprecated.\s+' | ||
94 | 124 | r'Use \"message.getOpenIDNamespace\(\)\" instead'), | ||
95 | 125 | DeprecationWarning | ||
96 | 126 | ) | ||
97 | 127 | # XXX cjwatson 2019-10-18: This can be dropped once the port to Breezy | 109 | # XXX cjwatson 2019-10-18: This can be dropped once the port to Breezy |
98 | 128 | # is complete. | 110 | # is complete. |
99 | 129 | warnings.filterwarnings( | 111 | warnings.filterwarnings( |
100 | diff --git a/lib/lp/services/openid/browser/openiddiscovery.py b/lib/lp/services/openid/browser/openiddiscovery.py | |||
101 | index 260f57c..2fe7023 100644 | |||
102 | --- a/lib/lp/services/openid/browser/openiddiscovery.py | |||
103 | +++ b/lib/lp/services/openid/browser/openiddiscovery.py | |||
104 | @@ -13,6 +13,7 @@ from openid.yadis.constants import ( | |||
105 | 13 | YADIS_CONTENT_TYPE, | 13 | YADIS_CONTENT_TYPE, |
106 | 14 | YADIS_HEADER_NAME, | 14 | YADIS_HEADER_NAME, |
107 | 15 | ) | 15 | ) |
108 | 16 | import six | ||
109 | 16 | 17 | ||
110 | 17 | from lp.services.openid.adapters.openid import CurrentOpenIDEndPoint | 18 | from lp.services.openid.adapters.openid import CurrentOpenIDEndPoint |
111 | 18 | from lp.services.propertycache import cachedproperty | 19 | from lp.services.propertycache import cachedproperty |
112 | @@ -55,9 +56,10 @@ class XRDSContentNegotiationMixin: | |||
113 | 55 | # the value of the "Accept" header. | 56 | # the value of the "Accept" header. |
114 | 56 | self.request.response.setHeader('Vary', 'Accept') | 57 | self.request.response.setHeader('Vary', 'Accept') |
115 | 57 | 58 | ||
117 | 58 | accept_content = self.request.get('HTTP_ACCEPT', '') | 59 | accept_content = six.ensure_text( |
118 | 60 | self.request.get('HTTP_ACCEPT', ''), encoding='ISO-8859-1') | ||
119 | 59 | acceptable = getAcceptable(accept_content, | 61 | acceptable = getAcceptable(accept_content, |
121 | 60 | ['text/html', YADIS_CONTENT_TYPE]) | 62 | [u'text/html', YADIS_CONTENT_TYPE]) |
122 | 61 | # Return the XRDS document if it is preferred to text/html. | 63 | # Return the XRDS document if it is preferred to text/html. |
123 | 62 | for mtype in acceptable: | 64 | for mtype in acceptable: |
124 | 63 | if mtype == 'text/html': | 65 | if mtype == 'text/html': |
125 | diff --git a/lib/lp/services/openid/extensions/macaroon.py b/lib/lp/services/openid/extensions/macaroon.py | |||
126 | index 30e1680..97a1731 100644 | |||
127 | --- a/lib/lp/services/openid/extensions/macaroon.py | |||
128 | +++ b/lib/lp/services/openid/extensions/macaroon.py | |||
129 | @@ -39,7 +39,8 @@ __all__ = [ | |||
130 | 39 | 'MacaroonResponse', | 39 | 'MacaroonResponse', |
131 | 40 | ] | 40 | ] |
132 | 41 | 41 | ||
134 | 42 | from openid import oidutil | 42 | import logging |
135 | 43 | |||
136 | 43 | from openid.extension import Extension | 44 | from openid.extension import Extension |
137 | 44 | from openid.message import ( | 45 | from openid.message import ( |
138 | 45 | NamespaceAliasRegistrationError, | 46 | NamespaceAliasRegistrationError, |
139 | @@ -50,10 +51,13 @@ from openid.message import ( | |||
140 | 50 | MACAROON_NS = 'http://ns.login.ubuntu.com/2016/openid-macaroon' | 51 | MACAROON_NS = 'http://ns.login.ubuntu.com/2016/openid-macaroon' |
141 | 51 | 52 | ||
142 | 52 | 53 | ||
143 | 54 | logger = logging.getLogger(__name__) | ||
144 | 55 | |||
145 | 56 | |||
146 | 53 | try: | 57 | try: |
147 | 54 | registerNamespaceAlias(MACAROON_NS, 'macaroon') | 58 | registerNamespaceAlias(MACAROON_NS, 'macaroon') |
148 | 55 | except NamespaceAliasRegistrationError as e: | 59 | except NamespaceAliasRegistrationError as e: |
150 | 56 | oidutil.log( | 60 | logger.exception( |
151 | 57 | 'registerNamespaceAlias(%r, %r) failed: %s' % ( | 61 | 'registerNamespaceAlias(%r, %r) failed: %s' % ( |
152 | 58 | MACAROON_NS, 'macaroon', e)) | 62 | MACAROON_NS, 'macaroon', e)) |
153 | 59 | 63 | ||
154 | diff --git a/lib/lp/services/openid/extensions/tests/test_macaroon.py b/lib/lp/services/openid/extensions/tests/test_macaroon.py | |||
155 | index bcbc8a8..c87f6cc 100644 | |||
156 | --- a/lib/lp/services/openid/extensions/tests/test_macaroon.py | |||
157 | +++ b/lib/lp/services/openid/extensions/tests/test_macaroon.py | |||
158 | @@ -1,6 +1,8 @@ | |||
159 | 1 | # Copyright 2016 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2016 Canonical Ltd. This software is licensed under the |
160 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
161 | 3 | 3 | ||
162 | 4 | from __future__ import absolute_import, print_function, unicode_literals | ||
163 | 5 | |||
164 | 4 | __metaclass__ = type | 6 | __metaclass__ = type |
165 | 5 | 7 | ||
166 | 6 | from openid.consumer.consumer import SuccessResponse | 8 | from openid.consumer.consumer import SuccessResponse |
167 | diff --git a/lib/lp/services/webapp/openid.py b/lib/lp/services/openid/fetcher.py | |||
168 | 7 | similarity index 84% | 9 | similarity index 84% |
169 | 8 | rename from lib/lp/services/webapp/openid.py | 10 | rename from lib/lp/services/webapp/openid.py |
170 | 9 | rename to lib/lp/services/openid/fetcher.py | 11 | rename to lib/lp/services/openid/fetcher.py |
171 | index 5e3f34e..3575124 100644 | |||
172 | --- a/lib/lp/services/webapp/openid.py | |||
173 | +++ b/lib/lp/services/openid/fetcher.py | |||
174 | @@ -21,12 +21,24 @@ from openid.fetchers import ( | |||
175 | 21 | from six.moves.urllib.request import urlopen | 21 | from six.moves.urllib.request import urlopen |
176 | 22 | 22 | ||
177 | 23 | from lp.services.config import config | 23 | from lp.services.config import config |
178 | 24 | from lp.services.encoding import wsgi_native_string | ||
179 | 25 | |||
180 | 26 | |||
181 | 27 | class WSGIFriendlyUrllib2Fetcher(Urllib2Fetcher): | ||
182 | 28 | |||
183 | 29 | def fetch(self, url, body=None, headers=None): | ||
184 | 30 | if headers is not None: | ||
185 | 31 | headers = { | ||
186 | 32 | wsgi_native_string(key): wsgi_native_string(value) | ||
187 | 33 | for key, value in headers.items()} | ||
188 | 34 | return super(WSGIFriendlyUrllib2Fetcher, self).fetch( | ||
189 | 35 | url, body=body, headers=headers) | ||
190 | 24 | 36 | ||
191 | 25 | 37 | ||
192 | 26 | def set_default_openid_fetcher(): | 38 | def set_default_openid_fetcher(): |
193 | 27 | # Make sure we're using the same fetcher that we use in production, even | 39 | # Make sure we're using the same fetcher that we use in production, even |
194 | 28 | # if pycurl is installed. | 40 | # if pycurl is installed. |
196 | 29 | fetcher = Urllib2Fetcher() | 41 | fetcher = WSGIFriendlyUrllib2Fetcher() |
197 | 30 | if config.launchpad.enable_test_openid_provider: | 42 | if config.launchpad.enable_test_openid_provider: |
198 | 31 | # Tests have an instance name that looks like 'testrunner-appserver' | 43 | # Tests have an instance name that looks like 'testrunner-appserver' |
199 | 32 | # or similar. We're in 'development' there, so just use that config. | 44 | # or similar. We're in 'development' there, so just use that config. |
200 | diff --git a/lib/lp/services/webapp/login.py b/lib/lp/services/webapp/login.py | |||
201 | index fdbd079..5367047 100644 | |||
202 | --- a/lib/lp/services/webapp/login.py | |||
203 | +++ b/lib/lp/services/webapp/login.py | |||
204 | @@ -66,7 +66,6 @@ from lp.services.webapp.interfaces import ( | |||
205 | 66 | IPlacelessLoginSource, | 66 | IPlacelessLoginSource, |
206 | 67 | LoggedOutEvent, | 67 | LoggedOutEvent, |
207 | 68 | ) | 68 | ) |
208 | 69 | from lp.services.webapp.openid import set_default_openid_fetcher | ||
209 | 70 | from lp.services.webapp.publisher import LaunchpadView | 69 | from lp.services.webapp.publisher import LaunchpadView |
210 | 71 | from lp.services.webapp.url import urlappend | 70 | from lp.services.webapp.url import urlappend |
211 | 72 | from lp.services.webapp.vhosts import allvhosts | 71 | from lp.services.webapp.vhosts import allvhosts |
212 | @@ -160,9 +159,6 @@ def register_basiclogin(event): | |||
213 | 160 | name='+basiclogin') | 159 | name='+basiclogin') |
214 | 161 | 160 | ||
215 | 162 | 161 | ||
216 | 163 | set_default_openid_fetcher() | ||
217 | 164 | |||
218 | 165 | |||
219 | 166 | class OpenIDLogin(LaunchpadView): | 162 | class OpenIDLogin(LaunchpadView): |
220 | 167 | """A view which initiates the OpenID handshake with our provider.""" | 163 | """A view which initiates the OpenID handshake with our provider.""" |
221 | 168 | _openid_session_ns = 'OPENID' | 164 | _openid_session_ns = 'OPENID' |
222 | diff --git a/lib/lp/testopenid/browser/server.py b/lib/lp/testopenid/browser/server.py | |||
223 | index c3d540a..f2ce757 100644 | |||
224 | --- a/lib/lp/testopenid/browser/server.py | |||
225 | +++ b/lib/lp/testopenid/browser/server.py | |||
226 | @@ -15,7 +15,6 @@ __all__ = [ | |||
227 | 15 | 15 | ||
228 | 16 | from datetime import timedelta | 16 | from datetime import timedelta |
229 | 17 | 17 | ||
230 | 18 | from openid import oidutil | ||
231 | 19 | from openid.extensions.sreg import ( | 18 | from openid.extensions.sreg import ( |
232 | 20 | SRegRequest, | 19 | SRegRequest, |
233 | 21 | SRegResponse, | 20 | SRegResponse, |
234 | @@ -78,10 +77,6 @@ SESSION_PKG_KEY = 'TestOpenID' | |||
235 | 78 | openid_store = MemoryStore() | 77 | openid_store = MemoryStore() |
236 | 79 | 78 | ||
237 | 80 | 79 | ||
238 | 81 | # Shut up noisy OpenID library | ||
239 | 82 | oidutil.log = lambda message, level=0: None | ||
240 | 83 | |||
241 | 84 | |||
242 | 85 | @implementer(ICanonicalUrlData) | 80 | @implementer(ICanonicalUrlData) |
243 | 86 | class TestOpenIDRootUrlData: | 81 | class TestOpenIDRootUrlData: |
244 | 87 | """`ICanonicalUrlData` for the test OpenID provider.""" | 82 | """`ICanonicalUrlData` for the test OpenID provider.""" |
245 | @@ -151,8 +146,7 @@ class OpenIDMixin: | |||
246 | 151 | query = {} | 146 | query = {} |
247 | 152 | for key, value in self.request.form.items(): | 147 | for key, value in self.request.form.items(): |
248 | 153 | if key.startswith('openid.'): | 148 | if key.startswith('openid.'): |
251 | 154 | # All OpenID query args are supposed to be ASCII. | 149 | query[key] = value |
250 | 155 | query[key.encode('US-ASCII')] = value.encode('US-ASCII') | ||
252 | 156 | return query | 150 | return query |
253 | 157 | 151 | ||
254 | 158 | def getSession(self): | 152 | def getSession(self): |
255 | diff --git a/lib/lp/testopenid/interfaces/server.py b/lib/lp/testopenid/interfaces/server.py | |||
256 | index 434fee3..669476f 100644 | |||
257 | --- a/lib/lp/testopenid/interfaces/server.py | |||
258 | +++ b/lib/lp/testopenid/interfaces/server.py | |||
259 | @@ -9,6 +9,7 @@ __all__ = [ | |||
260 | 9 | 'ITestOpenIDPersistentIdentity', | 9 | 'ITestOpenIDPersistentIdentity', |
261 | 10 | ] | 10 | ] |
262 | 11 | 11 | ||
263 | 12 | import six | ||
264 | 12 | from zope.interface import Interface | 13 | from zope.interface import Interface |
265 | 13 | from zope.schema import TextLine | 14 | from zope.schema import TextLine |
266 | 14 | 15 | ||
267 | @@ -36,4 +37,5 @@ def get_server_url(): | |||
268 | 36 | This is wrapped in a function (instead of a constant) to make sure the | 37 | This is wrapped in a function (instead of a constant) to make sure the |
269 | 37 | vhost.testopenid section is not required in production configs. | 38 | vhost.testopenid section is not required in production configs. |
270 | 38 | """ | 39 | """ |
272 | 39 | return urlappend(allvhosts.configs['testopenid'].rooturl, '+openid') | 40 | return six.ensure_text( |
273 | 41 | urlappend(allvhosts.configs['testopenid'].rooturl, '+openid')) | ||
274 | diff --git a/lib/lp/testopenid/stories/basics.txt b/lib/lp/testopenid/stories/basics.txt | |||
275 | index 56c6f4e..6672e40 100644 | |||
276 | --- a/lib/lp/testopenid/stories/basics.txt | |||
277 | +++ b/lib/lp/testopenid/stories/basics.txt | |||
278 | @@ -37,7 +37,7 @@ POST request. | |||
279 | 37 | >>> print anon_browser.headers | 37 | >>> print anon_browser.headers |
280 | 38 | Status: 200 Ok | 38 | Status: 200 Ok |
281 | 39 | ... | 39 | ... |
283 | 40 | Content-Type: text/plain | 40 | Content-Type: text/plain;charset=utf-8 |
284 | 41 | ... | 41 | ... |
285 | 42 | >>> print anon_browser.contents | 42 | >>> print anon_browser.contents |
286 | 43 | assoc_handle:{HMAC-SHA1}{...}{...} | 43 | assoc_handle:{HMAC-SHA1}{...}{...} |
287 | diff --git a/lib/lp/testopenid/testing/helpers.py b/lib/lp/testopenid/testing/helpers.py | |||
288 | index 27f9855..99cd52d 100644 | |||
289 | --- a/lib/lp/testopenid/testing/helpers.py | |||
290 | +++ b/lib/lp/testopenid/testing/helpers.py | |||
291 | @@ -21,6 +21,7 @@ from openid.consumer.discover import ( | |||
292 | 21 | from six.moves.urllib.error import HTTPError | 21 | from six.moves.urllib.error import HTTPError |
293 | 22 | from zope.testbrowser.wsgi import Browser | 22 | from zope.testbrowser.wsgi import Browser |
294 | 23 | 23 | ||
295 | 24 | from lp.services.encoding import wsgi_native_string | ||
296 | 24 | from lp.services.webapp import LaunchpadView | 25 | from lp.services.webapp import LaunchpadView |
297 | 25 | from lp.testopenid.interfaces.server import get_server_url | 26 | from lp.testopenid.interfaces.server import get_server_url |
298 | 26 | 27 | ||
299 | @@ -44,8 +45,8 @@ class ZopeFetcher(fetchers.HTTPFetcher): | |||
300 | 44 | browser = Browser() | 45 | browser = Browser() |
301 | 45 | if headers is not None: | 46 | if headers is not None: |
302 | 46 | for key, value in headers.items(): | 47 | for key, value in headers.items(): |
305 | 47 | browser.addHeader(key, value) | 48 | browser.addHeader(key, wsgi_native_string(value)) |
306 | 48 | browser.addHeader('X-Zope-Handle-Errors', 'True') | 49 | browser.addHeader('X-Zope-Handle-Errors', wsgi_native_string('True')) |
307 | 49 | try: | 50 | try: |
308 | 50 | browser.open(url, data=body) | 51 | browser.open(url, data=body) |
309 | 51 | except HTTPError as e: | 52 | except HTTPError as e: |
310 | diff --git a/lib/lp_sitecustomize.py b/lib/lp_sitecustomize.py | |||
311 | index d23cd74..26085c0 100644 | |||
312 | --- a/lib/lp_sitecustomize.py | |||
313 | +++ b/lib/lp_sitecustomize.py | |||
314 | @@ -21,6 +21,7 @@ from lp.services.log import loglevels | |||
315 | 21 | from lp.services.log.logger import LaunchpadLogger | 21 | from lp.services.log.logger import LaunchpadLogger |
316 | 22 | from lp.services.log.mappingfilter import MappingFilter | 22 | from lp.services.log.mappingfilter import MappingFilter |
317 | 23 | from lp.services.mime import customizeMimetypes | 23 | from lp.services.mime import customizeMimetypes |
318 | 24 | from lp.services.openid.fetcher import set_default_openid_fetcher | ||
319 | 24 | 25 | ||
320 | 25 | 26 | ||
321 | 26 | def add_custom_loglevels(): | 27 | def add_custom_loglevels(): |
322 | @@ -178,6 +179,7 @@ def main(instance_name=None): | |||
323 | 178 | customizeMimetypes() | 179 | customizeMimetypes() |
324 | 179 | silence_warnings() | 180 | silence_warnings() |
325 | 180 | customize_logger() | 181 | customize_logger() |
326 | 182 | set_default_openid_fetcher() | ||
327 | 181 | checker.BasicTypes.update({defaultdict: checker.NoProxy}) | 183 | checker.BasicTypes.update({defaultdict: checker.NoProxy}) |
328 | 182 | checker.BasicTypes.update({Deferred: checker.NoProxy}) | 184 | checker.BasicTypes.update({Deferred: checker.NoProxy}) |
329 | 183 | checker.BasicTypes.update({DeferredList: checker.NoProxy}) | 185 | checker.BasicTypes.update({DeferredList: checker.NoProxy}) |
330 | diff --git a/setup.py b/setup.py | |||
331 | index b724650..db7963e 100644 | |||
332 | --- a/setup.py | |||
333 | +++ b/setup.py | |||
334 | @@ -216,7 +216,7 @@ setup( | |||
335 | 216 | 'python-keystoneclient', | 216 | 'python-keystoneclient', |
336 | 217 | 'python-memcached', | 217 | 'python-memcached', |
337 | 218 | 'python-mimeparse', | 218 | 'python-mimeparse', |
339 | 219 | 'python-openid', | 219 | 'python-openid2', |
340 | 220 | 'python-subunit', | 220 | 'python-subunit', |
341 | 221 | 'python-swiftclient', | 221 | 'python-swiftclient', |
342 | 222 | 'pytz', | 222 | 'pytz', |
LGTM