Merge ~cjwatson/launchpad:py3only-urllib-imports into launchpad:master
- Git
- lp:~cjwatson/launchpad
- py3only-urllib-imports
- Merge into master
Proposed by
Colin Watson
Status: | Merged |
---|---|
Approved by: | Colin Watson |
Approved revision: | 54cc9535296423a10fdbd497ee1053f79eb58675 |
Merge reported by: | Otto Co-Pilot |
Merged at revision: | not available |
Proposed branch: | ~cjwatson/launchpad:py3only-urllib-imports |
Merge into: | launchpad:master |
Diff against target: |
2723 lines (+289/-279) 146 files modified
lib/launchpad_loggerhead/app.py (+4/-4) lib/launchpad_loggerhead/tests.py (+4/-3) lib/lp/answers/browser/faqcollection.py (+1/-1) lib/lp/answers/browser/questiontarget.py (+1/-1) lib/lp/answers/browser/tests/test_questiontarget.py (+1/-1) lib/lp/app/browser/launchpad.py (+2/-2) lib/lp/app/browser/tales.py (+1/-1) lib/lp/app/browser/tests/test_vocabulary.py (+1/-1) lib/lp/app/tests/test_services.py (+1/-1) lib/lp/app/validators/url.py (+1/-2) lib/lp/bugs/browser/buglisting.py (+6/-6) lib/lp/bugs/browser/bugtarget.py (+4/-4) lib/lp/bugs/browser/bugtask.py (+1/-1) lib/lp/bugs/browser/person.py (+1/-1) lib/lp/bugs/browser/tests/test_bugattachment_file_access.py (+3/-3) lib/lp/bugs/browser/tests/test_bugsubscriptionfilter.py (+1/-1) lib/lp/bugs/browser/tests/test_bugtask.py (+1/-1) lib/lp/bugs/browser/tests/test_structuralsubscription.py (+2/-1) lib/lp/bugs/doc/externalbugtracker-trac-lp-plugin.txt (+1/-1) lib/lp/bugs/doc/sourceforge-remote-products.txt (+1/-1) lib/lp/bugs/externalbugtracker/base.py (+3/-2) lib/lp/bugs/externalbugtracker/github.py (+4/-4) lib/lp/bugs/externalbugtracker/gitlab.py (+3/-3) lib/lp/bugs/externalbugtracker/mantis.py (+4/-4) lib/lp/bugs/externalbugtracker/roundup.py (+1/-1) lib/lp/bugs/externalbugtracker/tests/test_github.py (+4/-4) lib/lp/bugs/externalbugtracker/tests/test_gitlab.py (+4/-4) lib/lp/bugs/externalbugtracker/tests/test_mantis.py (+2/-1) lib/lp/bugs/externalbugtracker/xmlrpc.py (+4/-4) lib/lp/bugs/model/bugtracker.py (+5/-5) lib/lp/bugs/stories/bug-also-affects/xx-upstream-bugtracker-links.txt (+1/-1) lib/lp/bugs/stories/bugs/xx-bugs-advanced-search-upstream-status.txt (+1/-1) lib/lp/bugs/stories/bugtask-searches/xx-old-urls-still-work.txt (+1/-1) lib/lp/bugs/stories/webservice/xx-bug.txt (+1/-1) lib/lp/bugs/tests/externalbugtracker.py (+4/-4) lib/lp/bugs/tests/test_bugtracker.py (+1/-1) lib/lp/bugs/tests/test_bugwatch.py (+1/-1) lib/lp/buildmaster/interactor.py (+1/-1) lib/lp/buildmaster/tests/builderproxy.py (+1/-1) lib/lp/charms/tests/test_charmrecipebuildbehaviour.py (+1/-1) lib/lp/code/browser/branchlisting.py (+1/-1) lib/lp/code/browser/branchmergeproposal.py (+4/-4) lib/lp/code/browser/codeimport.py (+1/-1) lib/lp/code/browser/gitref.py (+4/-4) lib/lp/code/browser/gitrepository.py (+4/-4) lib/lp/code/browser/tests/test_gitsubscription.py (+2/-1) lib/lp/code/interfaces/codehosting.py (+1/-1) lib/lp/code/model/branch.py (+1/-1) lib/lp/code/model/branchhosting.py (+4/-4) lib/lp/code/model/githosting.py (+4/-4) lib/lp/code/model/gitref.py (+5/-5) lib/lp/code/model/gitrepository.py (+5/-5) lib/lp/code/model/tests/test_githosting.py (+4/-4) lib/lp/code/stories/branches/xx-private-branch-listings.txt (+1/-1) lib/lp/code/stories/branches/xx-subscribing-branches.txt (+1/-1) lib/lp/code/xmlrpc/git.py (+1/-1) lib/lp/code/xmlrpc/tests/test_git.py (+1/-1) lib/lp/codehosting/puller/tests/test_errors.py (+1/-1) lib/lp/codehosting/puller/worker.py (+2/-1) lib/lp/codehosting/scanner/buglinks.py (+2/-1) lib/lp/codehosting/sshserver/session.py (+1/-1) lib/lp/codehosting/tests/test_acceptance.py (+1/-1) lib/lp/oci/browser/tests/test_ocirecipe.py (+1/-1) lib/lp/oci/model/ociregistryclient.py (+1/-1) lib/lp/oci/tests/test_ocirecipebuild.py (+1/-1) lib/lp/oci/tests/test_ocirecipebuildbehaviour.py (+1/-1) lib/lp/oci/vocabularies.py (+2/-1) lib/lp/registry/browser/mailinglists.py (+1/-1) lib/lp/registry/browser/ociproject.py (+3/-2) lib/lp/registry/browser/person.py (+4/-4) lib/lp/registry/browser/product.py (+1/-1) lib/lp/registry/browser/sourcepackage.py (+1/-1) lib/lp/registry/browser/team.py (+1/-1) lib/lp/registry/browser/tests/test_distroseries.py (+4/-4) lib/lp/registry/browser/tests/test_person.py (+1/-1) lib/lp/registry/browser/tests/test_product.py (+4/-4) lib/lp/registry/browser/tests/test_sourcepackage_views.py (+2/-1) lib/lp/registry/scripts/distributionmirror_prober.py (+6/-6) lib/lp/registry/scripts/productreleasefinder/finder.py (+1/-1) lib/lp/registry/scripts/productreleasefinder/walker.py (+5/-5) lib/lp/registry/stories/product/xx-product-files.txt (+2/-2) lib/lp/services/feeds/feed.py (+1/-1) lib/lp/services/gpg/handler.py (+1/-1) lib/lp/services/librarian/client.py (+6/-6) lib/lp/services/librarian/doc/librarian.txt (+1/-1) lib/lp/services/librarian/model.py (+1/-1) lib/lp/services/librarian/smoketest.py (+1/-1) lib/lp/services/librarian/tests/test_client.py (+5/-5) lib/lp/services/librarianserver/db.py (+4/-4) lib/lp/services/librarianserver/swift.py (+1/-1) lib/lp/services/librarianserver/testing/fake.py (+1/-1) lib/lp/services/librarianserver/testing/tests/test_server_fixture.py (+1/-2) lib/lp/services/librarianserver/tests/test_db_outage.py (+2/-2) lib/lp/services/librarianserver/tests/test_gc.py (+1/-1) lib/lp/services/librarianserver/tests/test_web.py (+1/-1) lib/lp/services/librarianserver/web.py (+1/-1) lib/lp/services/oauth/stories/access-token.txt (+1/-1) lib/lp/services/oauth/stories/authorize-token.txt (+1/-1) lib/lp/services/oauth/stories/request-token.txt (+1/-1) lib/lp/services/openid/fetcher.py (+1/-1) lib/lp/services/scripts/base.py (+4/-4) lib/lp/services/signing/proxy.py (+1/-1) lib/lp/services/sitesearch/__init__.py (+5/-4) lib/lp/services/verification/browser/logintoken.py (+2/-1) lib/lp/services/webapp/doc/webapp-publication.txt (+1/-1) lib/lp/services/webapp/errorlog.py (+1/-1) lib/lp/services/webapp/login.py (+1/-1) lib/lp/services/webapp/publication.py (+1/-1) lib/lp/services/webapp/publisher.py (+1/-1) lib/lp/services/webapp/servers.py (+1/-1) lib/lp/services/webapp/tests/test_error.py (+1/-1) lib/lp/services/webapp/tests/test_login.py (+6/-6) lib/lp/services/webapp/tests/test_login_account.py (+1/-1) lib/lp/services/webapp/url.py (+2/-2) lib/lp/services/webhooks/model.py (+1/-1) lib/lp/services/webservice/wadl.py (+2/-2) lib/lp/snappy/browser/snap.py (+2/-1) lib/lp/snappy/browser/tests/test_snap.py (+4/-4) lib/lp/snappy/model/snap.py (+1/-1) lib/lp/snappy/model/snapstoreclient.py (+1/-1) lib/lp/snappy/tests/test_snap.py (+1/-1) lib/lp/snappy/tests/test_snapbuild.py (+1/-1) lib/lp/snappy/tests/test_snapbuildbehaviour.py (+1/-1) lib/lp/soyuz/browser/widgets/archive.py (+1/-1) lib/lp/soyuz/interfaces/archive.py (+1/-1) lib/lp/soyuz/scripts/ppa_apache_log_parser.py (+1/-2) lib/lp/soyuz/tests/test_archive.py (+1/-1) lib/lp/soyuz/tests/test_livefsbuild.py (+2/-2) lib/lp/soyuz/tests/test_packageupload.py (+1/-1) lib/lp/testing/keyserver/tests/test_harness.py (+1/-1) lib/lp/testing/layers.py (+6/-6) lib/lp/testing/pages.py (+1/-1) lib/lp/testing/publication.py (+2/-2) lib/lp/testing/tests/test_layers_functional.py (+2/-2) lib/lp/testing/tests/test_publication.py (+2/-1) lib/lp/testopenid/stories/basics.txt (+1/-1) lib/lp/testopenid/testing/helpers.py (+1/-1) lib/lp/translations/browser/person.py (+1/-1) lib/lp/translations/browser/pofile.py (+1/-1) lib/lp/translations/browser/tests/test_persontranslationview.py (+2/-1) lib/lp/translations/browser/translationmessage.py (+3/-3) lib/lp/translations/doc/poexport-request-productseries.txt (+1/-1) lib/lp/translations/doc/poexport-request.txt (+1/-1) lib/lp/translations/stories/importqueue/xx-translation-import-queue.txt (+1/-1) utilities/paste (+2/-3) utilities/roundup-sniffer.py (+2/-3) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Guruprasad | Approve | ||
Review via email: mp+420569@code.launchpad.net |
Commit message
Stop using six.moves for urllib imports
Description of the change
Largely mechanical, aided by `isort`.
To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) : | # |
Revision history for this message
Guruprasad (lgp171188) : | # |
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | diff --git a/lib/launchpad_loggerhead/app.py b/lib/launchpad_loggerhead/app.py |
2 | index 3e693f2..7697cc9 100644 |
3 | --- a/lib/launchpad_loggerhead/app.py |
4 | +++ b/lib/launchpad_loggerhead/app.py |
5 | @@ -4,6 +4,10 @@ |
6 | import logging |
7 | import os |
8 | import threading |
9 | +from urllib.parse import ( |
10 | + urlencode, |
11 | + urljoin, |
12 | + ) |
13 | import xmlrpc.client |
14 | |
15 | from breezy import ( |
16 | @@ -40,10 +44,6 @@ from paste.request import ( |
17 | parse_querystring, |
18 | path_info_pop, |
19 | ) |
20 | -from six.moves.urllib.parse import ( |
21 | - urlencode, |
22 | - urljoin, |
23 | - ) |
24 | |
25 | from lp.code.interfaces.codehosting import ( |
26 | BRANCH_TRANSPORT, |
27 | diff --git a/lib/launchpad_loggerhead/tests.py b/lib/launchpad_loggerhead/tests.py |
28 | index cad2ec3..52cd884 100644 |
29 | --- a/lib/launchpad_loggerhead/tests.py |
30 | +++ b/lib/launchpad_loggerhead/tests.py |
31 | @@ -1,12 +1,13 @@ |
32 | # Copyright 2010-2018 Canonical Ltd. This software is licensed under the |
33 | # GNU Affero General Public License version 3 (see the file LICENSE). |
34 | |
35 | -from paste.httpexceptions import HTTPExceptionHandler |
36 | -import requests |
37 | -from six.moves.urllib_parse import ( |
38 | +from urllib.parse import ( |
39 | urlencode, |
40 | urlsplit, |
41 | ) |
42 | + |
43 | +from paste.httpexceptions import HTTPExceptionHandler |
44 | +import requests |
45 | import soupmatchers |
46 | from testtools.content import Content |
47 | from testtools.content_type import UTF8_TEXT |
48 | diff --git a/lib/lp/answers/browser/faqcollection.py b/lib/lp/answers/browser/faqcollection.py |
49 | index a32ebca..a2fb420 100644 |
50 | --- a/lib/lp/answers/browser/faqcollection.py |
51 | +++ b/lib/lp/answers/browser/faqcollection.py |
52 | @@ -8,7 +8,7 @@ __all__ = [ |
53 | 'SearchFAQsView', |
54 | ] |
55 | |
56 | -from six.moves.urllib.parse import urlencode |
57 | +from urllib.parse import urlencode |
58 | |
59 | from lp import _ |
60 | from lp.answers.enums import ( |
61 | diff --git a/lib/lp/answers/browser/questiontarget.py b/lib/lp/answers/browser/questiontarget.py |
62 | index 57d8caa..5eb0c08 100644 |
63 | --- a/lib/lp/answers/browser/questiontarget.py |
64 | +++ b/lib/lp/answers/browser/questiontarget.py |
65 | @@ -19,13 +19,13 @@ __all__ = [ |
66 | ] |
67 | |
68 | from operator import attrgetter |
69 | +from urllib.parse import urlencode |
70 | |
71 | from lazr.restful.interfaces import ( |
72 | IJSONRequestCache, |
73 | IWebServiceClientRequest, |
74 | ) |
75 | from simplejson import dumps |
76 | -from six.moves.urllib.parse import urlencode |
77 | from zope.browserpage import ViewPageTemplateFile |
78 | from zope.component import ( |
79 | getMultiAdapter, |
80 | diff --git a/lib/lp/answers/browser/tests/test_questiontarget.py b/lib/lp/answers/browser/tests/test_questiontarget.py |
81 | index 307d038..386846f 100644 |
82 | --- a/lib/lp/answers/browser/tests/test_questiontarget.py |
83 | +++ b/lib/lp/answers/browser/tests/test_questiontarget.py |
84 | @@ -5,12 +5,12 @@ |
85 | |
86 | import json |
87 | import os |
88 | +from urllib.parse import quote |
89 | |
90 | from lazr.restful.interfaces import ( |
91 | IJSONRequestCache, |
92 | IWebServiceClientRequest, |
93 | ) |
94 | -from six.moves.urllib.parse import quote |
95 | from zope.component import getUtility |
96 | from zope.security.proxy import removeSecurityProxy |
97 | from zope.traversing.browser import absoluteURL |
98 | diff --git a/lib/lp/app/browser/launchpad.py b/lib/lp/app/browser/launchpad.py |
99 | index 110a34a..c887a24 100644 |
100 | --- a/lib/lp/app/browser/launchpad.py |
101 | +++ b/lib/lp/app/browser/launchpad.py |
102 | @@ -26,11 +26,11 @@ import operator |
103 | import os |
104 | import re |
105 | import time |
106 | - |
107 | -from six.moves.urllib.parse import ( |
108 | +from urllib.parse import ( |
109 | parse_qs, |
110 | urlencode, |
111 | ) |
112 | + |
113 | from zope import i18n |
114 | from zope.component import ( |
115 | getGlobalSiteManager, |
116 | diff --git a/lib/lp/app/browser/tales.py b/lib/lp/app/browser/tales.py |
117 | index 304fb1b..cfe0af0 100644 |
118 | --- a/lib/lp/app/browser/tales.py |
119 | +++ b/lib/lp/app/browser/tales.py |
120 | @@ -16,12 +16,12 @@ import math |
121 | import os.path |
122 | import sys |
123 | from textwrap import dedent |
124 | +from urllib.parse import quote |
125 | |
126 | from lazr.enum import enumerated_type_registry |
127 | from lazr.restful.utils import get_current_browser_request |
128 | from lazr.uri import URI |
129 | import pytz |
130 | -from six.moves.urllib.parse import quote |
131 | from zope.browserpage import ViewPageTemplateFile |
132 | from zope.component import ( |
133 | adapter, |
134 | diff --git a/lib/lp/app/browser/tests/test_vocabulary.py b/lib/lp/app/browser/tests/test_vocabulary.py |
135 | index 644c72d..8a04ba5 100644 |
136 | --- a/lib/lp/app/browser/tests/test_vocabulary.py |
137 | +++ b/lib/lp/app/browser/tests/test_vocabulary.py |
138 | @@ -4,10 +4,10 @@ |
139 | """Test vocabulary adapters.""" |
140 | |
141 | from datetime import datetime |
142 | +from urllib.parse import urlencode |
143 | |
144 | import pytz |
145 | import simplejson |
146 | -from six.moves.urllib.parse import urlencode |
147 | from zope.component import ( |
148 | getSiteManager, |
149 | getUtility, |
150 | diff --git a/lib/lp/app/tests/test_services.py b/lib/lp/app/tests/test_services.py |
151 | index 0cbaee4..20f1670 100644 |
152 | --- a/lib/lp/app/tests/test_services.py |
153 | +++ b/lib/lp/app/tests/test_services.py |
154 | @@ -4,10 +4,10 @@ |
155 | """Tests for core services infrastructure.""" |
156 | |
157 | import json |
158 | +from urllib.parse import urlparse |
159 | |
160 | from fixtures import FakeLogger |
161 | from lazr.restful.interfaces._rest import IHTTPResource |
162 | -from six.moves.urllib.parse import urlparse |
163 | from zope.component import getUtility |
164 | from zope.interface import implementer |
165 | from zope.interface.interfaces import ComponentLookupError |
166 | diff --git a/lib/lp/app/validators/url.py b/lib/lp/app/validators/url.py |
167 | index dd29b7a..c90b4c9 100644 |
168 | --- a/lib/lp/app/validators/url.py |
169 | +++ b/lib/lp/app/validators/url.py |
170 | @@ -10,8 +10,7 @@ __all__ = [ |
171 | ] |
172 | |
173 | from textwrap import dedent |
174 | - |
175 | -from six.moves.urllib.parse import urlsplit |
176 | +from urllib.parse import urlsplit |
177 | |
178 | from lp import _ |
179 | from lp.app.validators import LaunchpadValidationError |
180 | diff --git a/lib/lp/bugs/browser/buglisting.py b/lib/lp/bugs/browser/buglisting.py |
181 | index cbc365b..4fbb813 100644 |
182 | --- a/lib/lp/bugs/browser/buglisting.py |
183 | +++ b/lib/lp/bugs/browser/buglisting.py |
184 | @@ -20,6 +20,12 @@ __all__ = [ |
185 | ] |
186 | |
187 | import os.path |
188 | +from urllib.parse import ( |
189 | + parse_qs, |
190 | + parse_qsl, |
191 | + quote, |
192 | + urlencode, |
193 | + ) |
194 | |
195 | from lazr.delegates import delegate_to |
196 | from lazr.restful.interfaces import IJSONRequestCache |
197 | @@ -27,12 +33,6 @@ from lazr.uri import URI |
198 | import pystache |
199 | from simplejson import dumps |
200 | from simplejson.encoder import JSONEncoderForHTML |
201 | -from six.moves.urllib.parse import ( |
202 | - parse_qs, |
203 | - parse_qsl, |
204 | - quote, |
205 | - urlencode, |
206 | - ) |
207 | from zope.authentication.interfaces import IUnauthenticatedPrincipal |
208 | from zope.browserpage import ViewPageTemplateFile |
209 | from zope.component import ( |
210 | diff --git a/lib/lp/bugs/browser/bugtarget.py b/lib/lp/bugs/browser/bugtarget.py |
211 | index cdceaea..1802a0e 100644 |
212 | --- a/lib/lp/bugs/browser/bugtarget.py |
213 | +++ b/lib/lp/bugs/browser/bugtarget.py |
214 | @@ -21,15 +21,15 @@ from datetime import datetime |
215 | from functools import partial |
216 | import http.client |
217 | from io import BytesIO |
218 | +from urllib.parse import ( |
219 | + quote, |
220 | + urlencode, |
221 | + ) |
222 | |
223 | from lazr.restful.interface import copy_field |
224 | from lazr.restful.interfaces import IJSONRequestCache |
225 | from pytz import timezone |
226 | from simplejson import dumps |
227 | -from six.moves.urllib.parse import ( |
228 | - quote, |
229 | - urlencode, |
230 | - ) |
231 | from zope.browserpage import ViewPageTemplateFile |
232 | from zope.component import getUtility |
233 | from zope.formlib.form import Fields |
234 | diff --git a/lib/lp/bugs/browser/bugtask.py b/lib/lp/bugs/browser/bugtask.py |
235 | index 6e85112..7af4f94 100644 |
236 | --- a/lib/lp/bugs/browser/bugtask.py |
237 | +++ b/lib/lp/bugs/browser/bugtask.py |
238 | @@ -33,6 +33,7 @@ from datetime import ( |
239 | from itertools import groupby |
240 | from operator import attrgetter |
241 | import re |
242 | +from urllib.parse import quote |
243 | |
244 | from lazr.delegates import delegate_to |
245 | from lazr.lifecycle.event import ObjectModifiedEvent |
246 | @@ -47,7 +48,6 @@ from lazr.restful.interfaces import ( |
247 | from lazr.restful.utils import smartquote |
248 | from pytz import utc |
249 | from simplejson import dumps |
250 | -from six.moves.urllib.parse import quote |
251 | import transaction |
252 | from zope import formlib |
253 | from zope.browserpage import ViewPageTemplateFile |
254 | diff --git a/lib/lp/bugs/browser/person.py b/lib/lp/bugs/browser/person.py |
255 | index 4b5de77..d9bc4b6 100644 |
256 | --- a/lib/lp/bugs/browser/person.py |
257 | +++ b/lib/lp/bugs/browser/person.py |
258 | @@ -16,8 +16,8 @@ __all__ = [ |
259 | |
260 | import copy |
261 | from operator import itemgetter |
262 | +from urllib.parse import urlencode |
263 | |
264 | -from six.moves.urllib.parse import urlencode |
265 | from zope.component import getUtility |
266 | |
267 | from lp.bugs.browser.buglisting import BugTaskSearchListingView |
268 | diff --git a/lib/lp/bugs/browser/tests/test_bugattachment_file_access.py b/lib/lp/bugs/browser/tests/test_bugattachment_file_access.py |
269 | index 3b48f29..52c2e36 100644 |
270 | --- a/lib/lp/bugs/browser/tests/test_bugattachment_file_access.py |
271 | +++ b/lib/lp/bugs/browser/tests/test_bugattachment_file_access.py |
272 | @@ -2,13 +2,13 @@ |
273 | # GNU Affero General Public License version 3 (see the file LICENSE). |
274 | |
275 | import re |
276 | - |
277 | -import requests |
278 | -from six.moves.urllib.parse import ( |
279 | +from urllib.parse import ( |
280 | parse_qs, |
281 | urlparse, |
282 | urlunparse, |
283 | ) |
284 | + |
285 | +import requests |
286 | import transaction |
287 | from zope.component import ( |
288 | getMultiAdapter, |
289 | diff --git a/lib/lp/bugs/browser/tests/test_bugsubscriptionfilter.py b/lib/lp/bugs/browser/tests/test_bugsubscriptionfilter.py |
290 | index 23f9c99..45ec289 100644 |
291 | --- a/lib/lp/bugs/browser/tests/test_bugsubscriptionfilter.py |
292 | +++ b/lib/lp/bugs/browser/tests/test_bugsubscriptionfilter.py |
293 | @@ -4,9 +4,9 @@ |
294 | """Tests for bug subscription filter browser code.""" |
295 | |
296 | import json |
297 | +from urllib.parse import urlparse |
298 | |
299 | from lxml import html |
300 | -from six.moves.urllib.parse import urlparse |
301 | from testtools.matchers import StartsWith |
302 | |
303 | from lp.app.enums import InformationType |
304 | diff --git a/lib/lp/bugs/browser/tests/test_bugtask.py b/lib/lp/bugs/browser/tests/test_bugtask.py |
305 | index 9c13e86..4394120 100644 |
306 | --- a/lib/lp/bugs/browser/tests/test_bugtask.py |
307 | +++ b/lib/lp/bugs/browser/tests/test_bugtask.py |
308 | @@ -6,12 +6,12 @@ from datetime import ( |
309 | timedelta, |
310 | ) |
311 | import re |
312 | +from urllib.parse import urlencode |
313 | |
314 | from lazr.restful.interfaces import IJSONRequestCache |
315 | from pytz import UTC |
316 | import simplejson |
317 | import six |
318 | -from six.moves.urllib.parse import urlencode |
319 | import soupmatchers |
320 | from testscenarios import ( |
321 | load_tests_apply_scenarios, |
322 | diff --git a/lib/lp/bugs/browser/tests/test_structuralsubscription.py b/lib/lp/bugs/browser/tests/test_structuralsubscription.py |
323 | index a6fd6a9..5aacbdb 100644 |
324 | --- a/lib/lp/bugs/browser/tests/test_structuralsubscription.py |
325 | +++ b/lib/lp/bugs/browser/tests/test_structuralsubscription.py |
326 | @@ -3,7 +3,8 @@ |
327 | |
328 | """Tests for structural subscription traversal.""" |
329 | |
330 | -from six.moves.urllib.parse import urlparse |
331 | +from urllib.parse import urlparse |
332 | + |
333 | from zope.publisher.interfaces import NotFound |
334 | |
335 | from lp.registry.browser.distribution import DistributionNavigation |
336 | diff --git a/lib/lp/bugs/doc/externalbugtracker-trac-lp-plugin.txt b/lib/lp/bugs/doc/externalbugtracker-trac-lp-plugin.txt |
337 | index 8c76531..6e5865f 100644 |
338 | --- a/lib/lp/bugs/doc/externalbugtracker-trac-lp-plugin.txt |
339 | +++ b/lib/lp/bugs/doc/externalbugtracker-trac-lp-plugin.txt |
340 | @@ -31,7 +31,7 @@ Trac to validate $token and return a Set-Cookie header. |
341 | |
342 | >>> import random |
343 | >>> import re |
344 | - >>> from six.moves.urllib_parse import ( |
345 | + >>> from urllib.parse import ( |
346 | ... urljoin, |
347 | ... urlsplit, |
348 | ... ) |
349 | diff --git a/lib/lp/bugs/doc/sourceforge-remote-products.txt b/lib/lp/bugs/doc/sourceforge-remote-products.txt |
350 | index 8f15721..edd70ce 100644 |
351 | --- a/lib/lp/bugs/doc/sourceforge-remote-products.txt |
352 | +++ b/lib/lp/bugs/doc/sourceforge-remote-products.txt |
353 | @@ -41,8 +41,8 @@ Define some request mocks so that we don't try to access SourceForge. |
354 | |
355 | >>> import os.path |
356 | >>> import re |
357 | + >>> from urllib.parse import urlsplit |
358 | >>> import responses |
359 | - >>> from six.moves.urllib_parse import urlsplit |
360 | |
361 | >>> def project_callback(request): |
362 | ... url = urlsplit(request.url) |
363 | diff --git a/lib/lp/bugs/externalbugtracker/base.py b/lib/lp/bugs/externalbugtracker/base.py |
364 | index 6ebd4bc..8cf7f0e 100644 |
365 | --- a/lib/lp/bugs/externalbugtracker/base.py |
366 | +++ b/lib/lp/bugs/externalbugtracker/base.py |
367 | @@ -26,11 +26,12 @@ __all__ = [ |
368 | ] |
369 | |
370 | |
371 | -import requests |
372 | -from six.moves.urllib_parse import ( |
373 | +from urllib.parse import ( |
374 | urljoin, |
375 | urlparse, |
376 | ) |
377 | + |
378 | +import requests |
379 | from zope.interface import implementer |
380 | |
381 | from lp.bugs.adapters import treelookup |
382 | diff --git a/lib/lp/bugs/externalbugtracker/github.py b/lib/lp/bugs/externalbugtracker/github.py |
383 | index 4e686ee..8f45e4d 100644 |
384 | --- a/lib/lp/bugs/externalbugtracker/github.py |
385 | +++ b/lib/lp/bugs/externalbugtracker/github.py |
386 | @@ -13,13 +13,13 @@ __all__ = [ |
387 | from contextlib import contextmanager |
388 | import http.client |
389 | import time |
390 | - |
391 | -import pytz |
392 | -import requests |
393 | -from six.moves.urllib.parse import ( |
394 | +from urllib.parse import ( |
395 | urlencode, |
396 | urlunsplit, |
397 | ) |
398 | + |
399 | +import pytz |
400 | +import requests |
401 | from zope.component import getUtility |
402 | from zope.interface import Interface |
403 | |
404 | diff --git a/lib/lp/bugs/externalbugtracker/gitlab.py b/lib/lp/bugs/externalbugtracker/gitlab.py |
405 | index cc7ac40..444fcb1 100644 |
406 | --- a/lib/lp/bugs/externalbugtracker/gitlab.py |
407 | +++ b/lib/lp/bugs/externalbugtracker/gitlab.py |
408 | @@ -9,14 +9,14 @@ __all__ = [ |
409 | ] |
410 | |
411 | import http.client |
412 | - |
413 | -import pytz |
414 | -from six.moves.urllib.parse import ( |
415 | +from urllib.parse import ( |
416 | quote, |
417 | quote_plus, |
418 | urlunsplit, |
419 | ) |
420 | |
421 | +import pytz |
422 | + |
423 | from lp.bugs.externalbugtracker import ( |
424 | BugTrackerConnectError, |
425 | ExternalBugTracker, |
426 | diff --git a/lib/lp/bugs/externalbugtracker/mantis.py b/lib/lp/bugs/externalbugtracker/mantis.py |
427 | index 40562da..bf10470 100644 |
428 | --- a/lib/lp/bugs/externalbugtracker/mantis.py |
429 | +++ b/lib/lp/bugs/externalbugtracker/mantis.py |
430 | @@ -11,15 +11,15 @@ __all__ = [ |
431 | import csv |
432 | import logging |
433 | import re |
434 | - |
435 | -from bs4.element import Comment |
436 | -from requests.cookies import RequestsCookieJar |
437 | -from six.moves.urllib_parse import ( |
438 | +from urllib.parse import ( |
439 | parse_qsl, |
440 | urlencode, |
441 | urlunparse, |
442 | ) |
443 | |
444 | +from bs4.element import Comment |
445 | +from requests.cookies import RequestsCookieJar |
446 | + |
447 | from lp.bugs.externalbugtracker import ( |
448 | BugNotFound, |
449 | BugTrackerConnectError, |
450 | diff --git a/lib/lp/bugs/externalbugtracker/roundup.py b/lib/lp/bugs/externalbugtracker/roundup.py |
451 | index 2bd3de2..84e7967 100644 |
452 | --- a/lib/lp/bugs/externalbugtracker/roundup.py |
453 | +++ b/lib/lp/bugs/externalbugtracker/roundup.py |
454 | @@ -6,9 +6,9 @@ |
455 | __all__ = ['Roundup'] |
456 | |
457 | import csv |
458 | +from urllib.parse import quote_plus |
459 | |
460 | from lazr.uri import URI |
461 | -from six.moves.urllib.parse import quote_plus |
462 | |
463 | from lp.bugs.externalbugtracker import ( |
464 | BugNotFound, |
465 | diff --git a/lib/lp/bugs/externalbugtracker/tests/test_github.py b/lib/lp/bugs/externalbugtracker/tests/test_github.py |
466 | index 87cdafa..b7644b5 100644 |
467 | --- a/lib/lp/bugs/externalbugtracker/tests/test_github.py |
468 | +++ b/lib/lp/bugs/externalbugtracker/tests/test_github.py |
469 | @@ -5,14 +5,14 @@ |
470 | |
471 | from datetime import datetime |
472 | import json |
473 | - |
474 | -import pytz |
475 | -import responses |
476 | -from six.moves.urllib_parse import ( |
477 | +from urllib.parse import ( |
478 | parse_qs, |
479 | urlsplit, |
480 | urlunsplit, |
481 | ) |
482 | + |
483 | +import pytz |
484 | +import responses |
485 | from testtools import ExpectedException |
486 | from testtools.matchers import ( |
487 | Contains, |
488 | diff --git a/lib/lp/bugs/externalbugtracker/tests/test_gitlab.py b/lib/lp/bugs/externalbugtracker/tests/test_gitlab.py |
489 | index 9fd7351..2ed17bf 100644 |
490 | --- a/lib/lp/bugs/externalbugtracker/tests/test_gitlab.py |
491 | +++ b/lib/lp/bugs/externalbugtracker/tests/test_gitlab.py |
492 | @@ -5,14 +5,14 @@ |
493 | |
494 | from datetime import datetime |
495 | import json |
496 | - |
497 | -import pytz |
498 | -import responses |
499 | -from six.moves.urllib_parse import ( |
500 | +from urllib.parse import ( |
501 | parse_qs, |
502 | urlsplit, |
503 | urlunsplit, |
504 | ) |
505 | + |
506 | +import pytz |
507 | +import responses |
508 | from testtools.matchers import ( |
509 | Contains, |
510 | ContainsDict, |
511 | diff --git a/lib/lp/bugs/externalbugtracker/tests/test_mantis.py b/lib/lp/bugs/externalbugtracker/tests/test_mantis.py |
512 | index 99de31b..3fc3010 100644 |
513 | --- a/lib/lp/bugs/externalbugtracker/tests/test_mantis.py |
514 | +++ b/lib/lp/bugs/externalbugtracker/tests/test_mantis.py |
515 | @@ -3,8 +3,9 @@ |
516 | |
517 | """Tests for the Mantis BugTracker.""" |
518 | |
519 | +from urllib.parse import urljoin |
520 | + |
521 | import responses |
522 | -from six.moves.urllib_parse import urljoin |
523 | from testtools.matchers import ( |
524 | Equals, |
525 | Is, |
526 | diff --git a/lib/lp/bugs/externalbugtracker/xmlrpc.py b/lib/lp/bugs/externalbugtracker/xmlrpc.py |
527 | index 6d63fe9..228a9de 100644 |
528 | --- a/lib/lp/bugs/externalbugtracker/xmlrpc.py |
529 | +++ b/lib/lp/bugs/externalbugtracker/xmlrpc.py |
530 | @@ -9,6 +9,10 @@ __all__ = [ |
531 | |
532 | |
533 | from io import BytesIO |
534 | +from urllib.parse import ( |
535 | + urlparse, |
536 | + urlunparse, |
537 | + ) |
538 | from xmlrpc.client import ( |
539 | ProtocolError, |
540 | Transport, |
541 | @@ -18,10 +22,6 @@ from defusedxml.xmlrpc import monkey_patch |
542 | import requests |
543 | from requests.cookies import RequestsCookieJar |
544 | import six |
545 | -from six.moves.urllib.parse import ( |
546 | - urlparse, |
547 | - urlunparse, |
548 | - ) |
549 | |
550 | from lp.bugs.externalbugtracker.base import repost_on_redirect_hook |
551 | from lp.services.config import config |
552 | diff --git a/lib/lp/bugs/model/bugtracker.py b/lib/lp/bugs/model/bugtracker.py |
553 | index a8070ae..9106ffe 100644 |
554 | --- a/lib/lp/bugs/model/bugtracker.py |
555 | +++ b/lib/lp/bugs/model/bugtracker.py |
556 | @@ -12,15 +12,15 @@ __all__ = [ |
557 | |
558 | from datetime import datetime |
559 | from itertools import chain |
560 | - |
561 | -from lazr.uri import URI |
562 | -from pytz import timezone |
563 | -import six |
564 | -from six.moves.urllib.parse import ( |
565 | +from urllib.parse import ( |
566 | quote, |
567 | urlsplit, |
568 | urlunsplit, |
569 | ) |
570 | + |
571 | +from lazr.uri import URI |
572 | +from pytz import timezone |
573 | +import six |
574 | from storm.expr import ( |
575 | Count, |
576 | Desc, |
577 | diff --git a/lib/lp/bugs/stories/bug-also-affects/xx-upstream-bugtracker-links.txt b/lib/lp/bugs/stories/bug-also-affects/xx-upstream-bugtracker-links.txt |
578 | index 1d29a68..d3656ca 100644 |
579 | --- a/lib/lp/bugs/stories/bug-also-affects/xx-upstream-bugtracker-links.txt |
580 | +++ b/lib/lp/bugs/stories/bug-also-affects/xx-upstream-bugtracker-links.txt |
581 | @@ -74,7 +74,7 @@ will be displayed. |
582 | The description given in the link to the bug filing form contains a |
583 | link back to bug 13, the place where it was originally filed. |
584 | |
585 | - >>> from six.moves.urllib.parse import ( |
586 | + >>> from urllib.parse import ( |
587 | ... parse_qs, |
588 | ... urlparse, |
589 | ... ) |
590 | diff --git a/lib/lp/bugs/stories/bugs/xx-bugs-advanced-search-upstream-status.txt b/lib/lp/bugs/stories/bugs/xx-bugs-advanced-search-upstream-status.txt |
591 | index bf2bed7..2211cbc 100644 |
592 | --- a/lib/lp/bugs/stories/bugs/xx-bugs-advanced-search-upstream-status.txt |
593 | +++ b/lib/lp/bugs/stories/bugs/xx-bugs-advanced-search-upstream-status.txt |
594 | @@ -144,7 +144,7 @@ status. Bookmarks of such searches work nevertheless. |
595 | |
596 | The user opens a bookmark for "upstream status doesn't matter" |
597 | |
598 | - >>> from six.moves.urllib.parse import urlencode |
599 | + >>> from urllib.parse import urlencode |
600 | >>> bookmark_params = { |
601 | ... 'field.status_upstream': '', |
602 | ... 'field.status_upstream-empty-marker': '1', |
603 | diff --git a/lib/lp/bugs/stories/bugtask-searches/xx-old-urls-still-work.txt b/lib/lp/bugs/stories/bugtask-searches/xx-old-urls-still-work.txt |
604 | index 2992c0b..9bf67e9 100644 |
605 | --- a/lib/lp/bugs/stories/bugtask-searches/xx-old-urls-still-work.txt |
606 | +++ b/lib/lp/bugs/stories/bugtask-searches/xx-old-urls-still-work.txt |
607 | @@ -22,7 +22,7 @@ The user is redirected to a new url to make the change explicit, and |
608 | to allow user agents (and users) to update bookmarks, etc. |
609 | |
610 | >>> def print_query_changes(query_string_before, query_string_after): |
611 | - ... from six.moves.urllib.parse import parse_qsl |
612 | + ... from urllib.parse import parse_qsl |
613 | ... query_before = parse_qsl( |
614 | ... query_string_before, keep_blank_values=True) |
615 | ... query_after = parse_qsl( |
616 | diff --git a/lib/lp/bugs/stories/webservice/xx-bug.txt b/lib/lp/bugs/stories/webservice/xx-bug.txt |
617 | index e19ef0f..718e63c 100644 |
618 | --- a/lib/lp/bugs/stories/webservice/xx-bug.txt |
619 | +++ b/lib/lp/bugs/stories/webservice/xx-bug.txt |
620 | @@ -1335,7 +1335,7 @@ we must follow to download the data. |
621 | Location: http://.../numbers.txt |
622 | ... |
623 | |
624 | - >>> from six.moves.urllib.request import urlopen |
625 | + >>> from urllib.request import urlopen |
626 | |
627 | >>> data = None |
628 | >>> conn = urlopen(data_response.getHeader('Location')) |
629 | diff --git a/lib/lp/bugs/tests/externalbugtracker.py b/lib/lp/bugs/tests/externalbugtracker.py |
630 | index a7706d7..11dcaab 100644 |
631 | --- a/lib/lp/bugs/tests/externalbugtracker.py |
632 | +++ b/lib/lp/bugs/tests/externalbugtracker.py |
633 | @@ -14,14 +14,14 @@ import os |
634 | import random |
635 | import re |
636 | import time |
637 | -import xmlrpc.client |
638 | - |
639 | -import responses |
640 | -from six.moves.urllib_parse import ( |
641 | +from urllib.parse import ( |
642 | parse_qs, |
643 | urljoin, |
644 | urlsplit, |
645 | ) |
646 | +import xmlrpc.client |
647 | + |
648 | +import responses |
649 | from zope.component import getUtility |
650 | from zope.security.proxy import removeSecurityProxy |
651 | |
652 | diff --git a/lib/lp/bugs/tests/test_bugtracker.py b/lib/lp/bugs/tests/test_bugtracker.py |
653 | index 59f4e7d..d4a3e28 100644 |
654 | --- a/lib/lp/bugs/tests/test_bugtracker.py |
655 | +++ b/lib/lp/bugs/tests/test_bugtracker.py |
656 | @@ -11,11 +11,11 @@ from doctest import ( |
657 | NORMALIZE_WHITESPACE, |
658 | ) |
659 | import unittest |
660 | +from urllib.parse import urlencode |
661 | |
662 | from lazr.lifecycle.snapshot import Snapshot |
663 | from pytz import utc |
664 | import responses |
665 | -from six.moves.urllib_parse import urlencode |
666 | from testtools.matchers import ( |
667 | Equals, |
668 | MatchesListwise, |
669 | diff --git a/lib/lp/bugs/tests/test_bugwatch.py b/lib/lp/bugs/tests/test_bugwatch.py |
670 | index 402253b..9a363d5 100644 |
671 | --- a/lib/lp/bugs/tests/test_bugwatch.py |
672 | +++ b/lib/lp/bugs/tests/test_bugwatch.py |
673 | @@ -8,10 +8,10 @@ from datetime import ( |
674 | timedelta, |
675 | ) |
676 | import re |
677 | +from urllib.parse import urlunsplit |
678 | |
679 | from lazr.lifecycle.snapshot import Snapshot |
680 | from pytz import utc |
681 | -from six.moves.urllib.parse import urlunsplit |
682 | from storm.store import Store |
683 | from testscenarios import ( |
684 | load_tests_apply_scenarios, |
685 | diff --git a/lib/lp/buildmaster/interactor.py b/lib/lp/buildmaster/interactor.py |
686 | index 679d5c6..eed2b23 100644 |
687 | --- a/lib/lp/buildmaster/interactor.py |
688 | +++ b/lib/lp/buildmaster/interactor.py |
689 | @@ -14,10 +14,10 @@ import logging |
690 | import os.path |
691 | import sys |
692 | import traceback |
693 | +from urllib.parse import urlparse |
694 | |
695 | from ampoule.pool import ProcessPool |
696 | import six |
697 | -from six.moves.urllib.parse import urlparse |
698 | import transaction |
699 | from twisted.internet import ( |
700 | defer, |
701 | diff --git a/lib/lp/buildmaster/tests/builderproxy.py b/lib/lp/buildmaster/tests/builderproxy.py |
702 | index 82197ed..356bc0f 100644 |
703 | --- a/lib/lp/buildmaster/tests/builderproxy.py |
704 | +++ b/lib/lp/buildmaster/tests/builderproxy.py |
705 | @@ -6,10 +6,10 @@ |
706 | from datetime import datetime |
707 | import json |
708 | from textwrap import dedent |
709 | +from urllib.parse import urlsplit |
710 | import uuid |
711 | |
712 | import fixtures |
713 | -from six.moves.urllib_parse import urlsplit |
714 | from testtools.matchers import ( |
715 | Equals, |
716 | HasLength, |
717 | diff --git a/lib/lp/charms/tests/test_charmrecipebuildbehaviour.py b/lib/lp/charms/tests/test_charmrecipebuildbehaviour.py |
718 | index 6cd8791..a473487 100644 |
719 | --- a/lib/lp/charms/tests/test_charmrecipebuildbehaviour.py |
720 | +++ b/lib/lp/charms/tests/test_charmrecipebuildbehaviour.py |
721 | @@ -7,11 +7,11 @@ import base64 |
722 | from datetime import datetime |
723 | import os.path |
724 | import time |
725 | +from urllib.parse import urlsplit |
726 | import uuid |
727 | |
728 | from fixtures import MockPatch |
729 | from pymacaroons import Macaroon |
730 | -from six.moves.urllib_parse import urlsplit |
731 | from testtools import ExpectedException |
732 | from testtools.matchers import ( |
733 | ContainsDict, |
734 | diff --git a/lib/lp/code/browser/branchlisting.py b/lib/lp/code/browser/branchlisting.py |
735 | index 56e26b2..eee45b8 100644 |
736 | --- a/lib/lp/code/browser/branchlisting.py |
737 | +++ b/lib/lp/code/browser/branchlisting.py |
738 | @@ -25,13 +25,13 @@ __all__ = [ |
739 | ] |
740 | |
741 | from operator import attrgetter |
742 | +from urllib.parse import parse_qs |
743 | |
744 | from lazr.delegates import delegate_to |
745 | from lazr.enum import ( |
746 | EnumeratedType, |
747 | Item, |
748 | ) |
749 | -from six.moves.urllib.parse import parse_qs |
750 | from storm.expr import Desc |
751 | from zope.browserpage import ViewPageTemplateFile |
752 | from zope.component import getUtility |
753 | diff --git a/lib/lp/code/browser/branchmergeproposal.py b/lib/lp/code/browser/branchmergeproposal.py |
754 | index 4e89019..fcaddeb 100644 |
755 | --- a/lib/lp/code/browser/branchmergeproposal.py |
756 | +++ b/lib/lp/code/browser/branchmergeproposal.py |
757 | @@ -26,6 +26,10 @@ __all__ = [ |
758 | |
759 | from functools import wraps |
760 | import operator |
761 | +from urllib.parse import ( |
762 | + urlsplit, |
763 | + urlunsplit, |
764 | + ) |
765 | |
766 | from lazr.delegates import delegate_to |
767 | from lazr.restful.interface import copy_field |
768 | @@ -34,10 +38,6 @@ from lazr.restful.interfaces import ( |
769 | IWebServiceClientRequest, |
770 | ) |
771 | import simplejson |
772 | -from six.moves.urllib_parse import ( |
773 | - urlsplit, |
774 | - urlunsplit, |
775 | - ) |
776 | from zope.component import ( |
777 | adapter, |
778 | getMultiAdapter, |
779 | diff --git a/lib/lp/code/browser/codeimport.py b/lib/lp/code/browser/codeimport.py |
780 | index 5ecf7d4..33a2cd4 100644 |
781 | --- a/lib/lp/code/browser/codeimport.py |
782 | +++ b/lib/lp/code/browser/codeimport.py |
783 | @@ -18,12 +18,12 @@ __all__ = [ |
784 | ] |
785 | |
786 | from textwrap import dedent |
787 | +from urllib.parse import urlparse |
788 | |
789 | from lazr.restful.interface import ( |
790 | copy_field, |
791 | use_template, |
792 | ) |
793 | -from six.moves.urllib.parse import urlparse |
794 | from zope.component import ( |
795 | getUtility, |
796 | queryAdapter, |
797 | diff --git a/lib/lp/code/browser/gitref.py b/lib/lp/code/browser/gitref.py |
798 | index fedff3e..bc72f3a 100644 |
799 | --- a/lib/lp/code/browser/gitref.py |
800 | +++ b/lib/lp/code/browser/gitref.py |
801 | @@ -10,14 +10,14 @@ __all__ = [ |
802 | ] |
803 | |
804 | import json |
805 | - |
806 | -from breezy import urlutils |
807 | -from lazr.restful.interface import copy_field |
808 | -from six.moves.urllib_parse import ( |
809 | +from urllib.parse import ( |
810 | quote_plus, |
811 | urlsplit, |
812 | urlunsplit, |
813 | ) |
814 | + |
815 | +from breezy import urlutils |
816 | +from lazr.restful.interface import copy_field |
817 | from zope.component import getUtility |
818 | from zope.formlib.widget import CustomWidgetFactory |
819 | from zope.formlib.widgets import TextAreaWidget |
820 | diff --git a/lib/lp/code/browser/gitrepository.py b/lib/lp/code/browser/gitrepository.py |
821 | index 072f626..96a6ce0 100644 |
822 | --- a/lib/lp/code/browser/gitrepository.py |
823 | +++ b/lib/lp/code/browser/gitrepository.py |
824 | @@ -23,6 +23,10 @@ __all__ = [ |
825 | import base64 |
826 | import binascii |
827 | from collections import defaultdict |
828 | +from urllib.parse import ( |
829 | + urlsplit, |
830 | + urlunsplit, |
831 | + ) |
832 | |
833 | from breezy import urlutils |
834 | from lazr.lifecycle.event import ObjectModifiedEvent |
835 | @@ -31,10 +35,6 @@ from lazr.restful.interface import ( |
836 | copy_field, |
837 | use_template, |
838 | ) |
839 | -from six.moves.urllib_parse import ( |
840 | - urlsplit, |
841 | - urlunsplit, |
842 | - ) |
843 | from zope.component import getUtility |
844 | from zope.event import notify |
845 | from zope.formlib import form |
846 | diff --git a/lib/lp/code/browser/tests/test_gitsubscription.py b/lib/lp/code/browser/tests/test_gitsubscription.py |
847 | index 1fb5fb7..6f2a5a6 100644 |
848 | --- a/lib/lp/code/browser/tests/test_gitsubscription.py |
849 | +++ b/lib/lp/code/browser/tests/test_gitsubscription.py |
850 | @@ -3,8 +3,9 @@ |
851 | |
852 | """Unit tests for GitSubscriptions.""" |
853 | |
854 | +from urllib.parse import urlencode |
855 | + |
856 | from fixtures import FakeLogger |
857 | -from six.moves.urllib.parse import urlencode |
858 | from testtools.matchers import MatchesStructure |
859 | from zope.security.interfaces import Unauthorized |
860 | from zope.testbrowser.browser import LinkNotFoundError |
861 | diff --git a/lib/lp/code/interfaces/codehosting.py b/lib/lp/code/interfaces/codehosting.py |
862 | index 91bce70..07a9411 100644 |
863 | --- a/lib/lp/code/interfaces/codehosting.py |
864 | +++ b/lib/lp/code/interfaces/codehosting.py |
865 | @@ -21,10 +21,10 @@ __all__ = [ |
866 | ] |
867 | |
868 | import os.path |
869 | +from urllib.parse import quote |
870 | |
871 | from lazr.uri import URI |
872 | import six |
873 | -from six.moves.urllib.parse import quote |
874 | from zope.interface import Interface |
875 | |
876 | from lp.app.validators.name import valid_name |
877 | diff --git a/lib/lp/code/model/branch.py b/lib/lp/code/model/branch.py |
878 | index fc7da1a..2b940ba 100644 |
879 | --- a/lib/lp/code/model/branch.py |
880 | +++ b/lib/lp/code/model/branch.py |
881 | @@ -11,6 +11,7 @@ from datetime import datetime |
882 | from functools import partial |
883 | import operator |
884 | import os.path |
885 | +from urllib.parse import urlsplit |
886 | |
887 | from breezy import urlutils |
888 | from breezy.revision import NULL_REVISION |
889 | @@ -18,7 +19,6 @@ from breezy.url_policy_open import open_only_scheme |
890 | from lazr.lifecycle.event import ObjectCreatedEvent |
891 | import pytz |
892 | import six |
893 | -from six.moves.urllib_parse import urlsplit |
894 | from storm.expr import ( |
895 | And, |
896 | Coalesce, |
897 | diff --git a/lib/lp/code/model/branchhosting.py b/lib/lp/code/model/branchhosting.py |
898 | index 3911c16..c585df2 100644 |
899 | --- a/lib/lp/code/model/branchhosting.py |
900 | +++ b/lib/lp/code/model/branchhosting.py |
901 | @@ -9,13 +9,13 @@ __all__ = [ |
902 | |
903 | import json |
904 | import sys |
905 | - |
906 | -from lazr.restful.utils import get_current_browser_request |
907 | -import requests |
908 | -from six.moves.urllib_parse import ( |
909 | +from urllib.parse import ( |
910 | quote, |
911 | urljoin, |
912 | ) |
913 | + |
914 | +from lazr.restful.utils import get_current_browser_request |
915 | +import requests |
916 | from zope.interface import implementer |
917 | |
918 | from lp.code.errors import ( |
919 | diff --git a/lib/lp/code/model/githosting.py b/lib/lp/code/model/githosting.py |
920 | index c5ade39..675b1eb 100644 |
921 | --- a/lib/lp/code/model/githosting.py |
922 | +++ b/lib/lp/code/model/githosting.py |
923 | @@ -11,14 +11,14 @@ __all__ = [ |
924 | import base64 |
925 | import json |
926 | import sys |
927 | +from urllib.parse import ( |
928 | + quote, |
929 | + urljoin, |
930 | + ) |
931 | |
932 | from lazr.restful.utils import get_current_browser_request |
933 | import requests |
934 | from six import ensure_text |
935 | -from six.moves.urllib.parse import ( |
936 | - quote, |
937 | - urljoin, |
938 | - ) |
939 | from zope.interface import implementer |
940 | |
941 | from lp.code.errors import ( |
942 | diff --git a/lib/lp/code/model/gitref.py b/lib/lp/code/model/gitref.py |
943 | index a3ef756..f91d1e5 100644 |
944 | --- a/lib/lp/code/model/gitref.py |
945 | +++ b/lib/lp/code/model/gitref.py |
946 | @@ -10,16 +10,16 @@ __all__ = [ |
947 | |
948 | from functools import partial |
949 | import re |
950 | +from urllib.parse import ( |
951 | + quote, |
952 | + quote_plus, |
953 | + urlsplit, |
954 | + ) |
955 | |
956 | from lazr.lifecycle.event import ObjectCreatedEvent |
957 | import pytz |
958 | import requests |
959 | import six |
960 | -from six.moves.urllib.parse import ( |
961 | - quote, |
962 | - quote_plus, |
963 | - urlsplit, |
964 | - ) |
965 | from storm.expr import And |
966 | from storm.locals import ( |
967 | DateTime, |
968 | diff --git a/lib/lp/code/model/gitrepository.py b/lib/lp/code/model/gitrepository.py |
969 | index f1a9dfa..39ffda1 100644 |
970 | --- a/lib/lp/code/model/gitrepository.py |
971 | +++ b/lib/lp/code/model/gitrepository.py |
972 | @@ -25,6 +25,11 @@ from itertools import ( |
973 | ) |
974 | import logging |
975 | from operator import attrgetter |
976 | +from urllib.parse import ( |
977 | + quote_plus, |
978 | + urlsplit, |
979 | + urlunsplit, |
980 | + ) |
981 | |
982 | from breezy import urlutils |
983 | from lazr.enum import DBItem |
984 | @@ -32,11 +37,6 @@ from lazr.lifecycle.event import ObjectModifiedEvent |
985 | from lazr.lifecycle.snapshot import Snapshot |
986 | import pytz |
987 | import six |
988 | -from six.moves.urllib.parse import ( |
989 | - quote_plus, |
990 | - urlsplit, |
991 | - urlunsplit, |
992 | - ) |
993 | from storm.databases.postgres import Returning |
994 | from storm.expr import ( |
995 | And, |
996 | diff --git a/lib/lp/code/model/tests/test_githosting.py b/lib/lp/code/model/tests/test_githosting.py |
997 | index ea1ebbd..ef7802c 100644 |
998 | --- a/lib/lp/code/model/tests/test_githosting.py |
999 | +++ b/lib/lp/code/model/tests/test_githosting.py |
1000 | @@ -11,13 +11,13 @@ import base64 |
1001 | from contextlib import contextmanager |
1002 | import json |
1003 | import re |
1004 | - |
1005 | -from lazr.restful.utils import get_current_browser_request |
1006 | -import responses |
1007 | -from six.moves.urllib.parse import ( |
1008 | +from urllib.parse import ( |
1009 | parse_qsl, |
1010 | urlsplit, |
1011 | ) |
1012 | + |
1013 | +from lazr.restful.utils import get_current_browser_request |
1014 | +import responses |
1015 | from testtools.matchers import ( |
1016 | AfterPreprocessing, |
1017 | Equals, |
1018 | diff --git a/lib/lp/code/stories/branches/xx-private-branch-listings.txt b/lib/lp/code/stories/branches/xx-private-branch-listings.txt |
1019 | index c775877..3e7fa21 100644 |
1020 | --- a/lib/lp/code/stories/branches/xx-private-branch-listings.txt |
1021 | +++ b/lib/lp/code/stories/branches/xx-private-branch-listings.txt |
1022 | @@ -145,7 +145,7 @@ Person code listing pages |
1023 | The person code listings is the other obvious place to filter out the |
1024 | viewable branches. |
1025 | |
1026 | - >>> from six.moves.urllib.parse import urlencode |
1027 | + >>> from urllib.parse import urlencode |
1028 | >>> def print_person_code_listing(browser, category=None): |
1029 | ... params = {'batch': '15'} |
1030 | ... if category is not None: |
1031 | diff --git a/lib/lp/code/stories/branches/xx-subscribing-branches.txt b/lib/lp/code/stories/branches/xx-subscribing-branches.txt |
1032 | index 1974c42..5db15a2 100644 |
1033 | --- a/lib/lp/code/stories/branches/xx-subscribing-branches.txt |
1034 | +++ b/lib/lp/code/stories/branches/xx-subscribing-branches.txt |
1035 | @@ -120,7 +120,7 @@ shown to the user. |
1036 | Clicking the back button and then clicking on either Change or |
1037 | Unsubscribe will give a message that we are not subscribed. |
1038 | |
1039 | - >>> from six.moves.urllib.parse import urlencode |
1040 | + >>> from urllib.parse import urlencode |
1041 | >>> browser.addHeader('Referer', 'https://launchpad.test/') |
1042 | >>> browser.open( |
1043 | ... form_url, |
1044 | diff --git a/lib/lp/code/xmlrpc/git.py b/lib/lp/code/xmlrpc/git.py |
1045 | index 23c67a2..6221845 100644 |
1046 | --- a/lib/lp/code/xmlrpc/git.py |
1047 | +++ b/lib/lp/code/xmlrpc/git.py |
1048 | @@ -9,12 +9,12 @@ __all__ = [ |
1049 | |
1050 | import logging |
1051 | import sys |
1052 | +from urllib.parse import quote |
1053 | import uuid |
1054 | import xmlrpc.client |
1055 | |
1056 | from pymacaroons import Macaroon |
1057 | import six |
1058 | -from six.moves.urllib.parse import quote |
1059 | import transaction |
1060 | from zope.component import getUtility |
1061 | from zope.error.interfaces import IErrorReportingUtility |
1062 | diff --git a/lib/lp/code/xmlrpc/tests/test_git.py b/lib/lp/code/xmlrpc/tests/test_git.py |
1063 | index 1f2b52a..131b803 100644 |
1064 | --- a/lib/lp/code/xmlrpc/tests/test_git.py |
1065 | +++ b/lib/lp/code/xmlrpc/tests/test_git.py |
1066 | @@ -5,6 +5,7 @@ |
1067 | |
1068 | from datetime import datetime |
1069 | import hashlib |
1070 | +from urllib.parse import quote |
1071 | import uuid |
1072 | import xmlrpc.client |
1073 | |
1074 | @@ -12,7 +13,6 @@ from fixtures import FakeLogger |
1075 | from pymacaroons import Macaroon |
1076 | import pytz |
1077 | import six |
1078 | -from six.moves.urllib.parse import quote |
1079 | from storm.store import Store |
1080 | from testtools.matchers import ( |
1081 | Equals, |
1082 | diff --git a/lib/lp/codehosting/puller/tests/test_errors.py b/lib/lp/codehosting/puller/tests/test_errors.py |
1083 | index f06ca00..4ec9a75 100644 |
1084 | --- a/lib/lp/codehosting/puller/tests/test_errors.py |
1085 | +++ b/lib/lp/codehosting/puller/tests/test_errors.py |
1086 | @@ -7,6 +7,7 @@ import http.client |
1087 | import os |
1088 | import socket |
1089 | import tempfile |
1090 | +from urllib.error import HTTPError |
1091 | |
1092 | from breezy.errors import ( |
1093 | BzrError, |
1094 | @@ -20,7 +21,6 @@ from breezy.url_policy_open import ( |
1095 | BranchReferenceForbidden, |
1096 | ) |
1097 | from lazr.uri import InvalidURIError |
1098 | -from six.moves.urllib.error import HTTPError |
1099 | |
1100 | from lp.code.enums import BranchType |
1101 | from lp.codehosting.puller.worker import ( |
1102 | diff --git a/lib/lp/codehosting/puller/worker.py b/lib/lp/codehosting/puller/worker.py |
1103 | index 5f4e58d..be4cb8c 100644 |
1104 | --- a/lib/lp/codehosting/puller/worker.py |
1105 | +++ b/lib/lp/codehosting/puller/worker.py |
1106 | @@ -9,6 +9,8 @@ import sys |
1107 | # line below this comment. |
1108 | import lp.codehosting # noqa: F401 # isort: split |
1109 | |
1110 | +from urllib.error import HTTPError |
1111 | + |
1112 | from breezy import ( |
1113 | errors, |
1114 | urlutils, |
1115 | @@ -39,7 +41,6 @@ from lazr.uri import ( |
1116 | URI, |
1117 | ) |
1118 | import six |
1119 | -from six.moves.urllib.error import HTTPError |
1120 | |
1121 | from lp.code.bzr import ( |
1122 | BranchFormat, |
1123 | diff --git a/lib/lp/codehosting/scanner/buglinks.py b/lib/lp/codehosting/scanner/buglinks.py |
1124 | index 33a18ed..f7fcfd5 100644 |
1125 | --- a/lib/lp/codehosting/scanner/buglinks.py |
1126 | +++ b/lib/lp/codehosting/scanner/buglinks.py |
1127 | @@ -7,8 +7,9 @@ __all__ = [ |
1128 | 'BugBranchLinker', |
1129 | ] |
1130 | |
1131 | +from urllib.parse import urlsplit |
1132 | + |
1133 | from breezy.bugtracker import InvalidBugStatus |
1134 | -from six.moves.urllib.parse import urlsplit |
1135 | from zope.component import getUtility |
1136 | |
1137 | from lp.app.errors import NotFoundError |
1138 | diff --git a/lib/lp/codehosting/sshserver/session.py b/lib/lp/codehosting/sshserver/session.py |
1139 | index 9dc9a5d..4f0d549 100644 |
1140 | --- a/lib/lp/codehosting/sshserver/session.py |
1141 | +++ b/lib/lp/codehosting/sshserver/session.py |
1142 | @@ -8,11 +8,11 @@ __all__ = [ |
1143 | ] |
1144 | |
1145 | import os |
1146 | +from urllib.parse import urlparse |
1147 | |
1148 | from lazr.sshserver.events import AvatarEvent |
1149 | from lazr.sshserver.session import DoNothingSession |
1150 | import six |
1151 | -from six.moves.urllib.parse import urlparse |
1152 | from twisted.internet import process |
1153 | from twisted.python import log |
1154 | from zope.event import notify |
1155 | diff --git a/lib/lp/codehosting/tests/test_acceptance.py b/lib/lp/codehosting/tests/test_acceptance.py |
1156 | index 0beee84..835b4d8 100644 |
1157 | --- a/lib/lp/codehosting/tests/test_acceptance.py |
1158 | +++ b/lib/lp/codehosting/tests/test_acceptance.py |
1159 | @@ -5,6 +5,7 @@ |
1160 | |
1161 | import os |
1162 | import re |
1163 | +from urllib.request import urlopen |
1164 | import xmlrpc.client |
1165 | |
1166 | import breezy.branch |
1167 | @@ -13,7 +14,6 @@ from breezy.tests.per_repository import all_repository_format_scenarios |
1168 | from breezy.urlutils import local_path_from_url |
1169 | from breezy.workingtree import WorkingTree |
1170 | import six |
1171 | -from six.moves.urllib.request import urlopen |
1172 | from testscenarios import ( |
1173 | load_tests_apply_scenarios, |
1174 | WithScenarios, |
1175 | diff --git a/lib/lp/oci/browser/tests/test_ocirecipe.py b/lib/lp/oci/browser/tests/test_ocirecipe.py |
1176 | index 9b17ee7..97fc3c9 100644 |
1177 | --- a/lib/lp/oci/browser/tests/test_ocirecipe.py |
1178 | +++ b/lib/lp/oci/browser/tests/test_ocirecipe.py |
1179 | @@ -8,10 +8,10 @@ from datetime import ( |
1180 | timedelta, |
1181 | ) |
1182 | from operator import attrgetter |
1183 | +from urllib.parse import quote |
1184 | |
1185 | from fixtures import FakeLogger |
1186 | import pytz |
1187 | -from six.moves.urllib.parse import quote |
1188 | import soupmatchers |
1189 | from storm.locals import Store |
1190 | from testtools.matchers import ( |
1191 | diff --git a/lib/lp/oci/model/ociregistryclient.py b/lib/lp/oci/model/ociregistryclient.py |
1192 | index e04a17a..1b71e33 100644 |
1193 | --- a/lib/lp/oci/model/ociregistryclient.py |
1194 | +++ b/lib/lp/oci/model/ociregistryclient.py |
1195 | @@ -16,6 +16,7 @@ import json |
1196 | import logging |
1197 | import re |
1198 | import tarfile |
1199 | +from urllib.parse import urlparse |
1200 | |
1201 | import boto3 |
1202 | from botocore.config import Config |
1203 | @@ -24,7 +25,6 @@ from requests.exceptions import ( |
1204 | HTTPError, |
1205 | ) |
1206 | from requests.utils import parse_dict_header |
1207 | -from six.moves.urllib.parse import urlparse |
1208 | from tenacity import ( |
1209 | before_log, |
1210 | retry, |
1211 | diff --git a/lib/lp/oci/tests/test_ocirecipebuild.py b/lib/lp/oci/tests/test_ocirecipebuild.py |
1212 | index 8a9c33b..3a1b83d 100644 |
1213 | --- a/lib/lp/oci/tests/test_ocirecipebuild.py |
1214 | +++ b/lib/lp/oci/tests/test_ocirecipebuild.py |
1215 | @@ -7,11 +7,11 @@ from datetime import ( |
1216 | datetime, |
1217 | timedelta, |
1218 | ) |
1219 | +from urllib.request import urlopen |
1220 | |
1221 | from fixtures import FakeLogger |
1222 | from pymacaroons import Macaroon |
1223 | import pytz |
1224 | -from six.moves.urllib.request import urlopen |
1225 | from testtools.matchers import ( |
1226 | ContainsDict, |
1227 | Equals, |
1228 | diff --git a/lib/lp/oci/tests/test_ocirecipebuildbehaviour.py b/lib/lp/oci/tests/test_ocirecipebuildbehaviour.py |
1229 | index 890a916..e4b0fa7 100644 |
1230 | --- a/lib/lp/oci/tests/test_ocirecipebuildbehaviour.py |
1231 | +++ b/lib/lp/oci/tests/test_ocirecipebuildbehaviour.py |
1232 | @@ -10,6 +10,7 @@ import os |
1233 | import shutil |
1234 | import tempfile |
1235 | import time |
1236 | +from urllib.parse import urlsplit |
1237 | import uuid |
1238 | |
1239 | import fixtures |
1240 | @@ -17,7 +18,6 @@ from fixtures import MockPatch |
1241 | from pymacaroons import Macaroon |
1242 | import pytz |
1243 | import six |
1244 | -from six.moves.urllib_parse import urlsplit |
1245 | from testtools import ExpectedException |
1246 | from testtools.matchers import ( |
1247 | AfterPreprocessing, |
1248 | diff --git a/lib/lp/oci/vocabularies.py b/lib/lp/oci/vocabularies.py |
1249 | index e8e60df..84b680b 100644 |
1250 | --- a/lib/lp/oci/vocabularies.py |
1251 | +++ b/lib/lp/oci/vocabularies.py |
1252 | @@ -5,10 +5,11 @@ |
1253 | |
1254 | __all__ = [] |
1255 | |
1256 | -from six.moves.urllib.parse import ( |
1257 | +from urllib.parse import ( |
1258 | quote, |
1259 | unquote, |
1260 | ) |
1261 | + |
1262 | from zope.component import getUtility |
1263 | from zope.interface import implementer |
1264 | from zope.schema.vocabulary import SimpleTerm |
1265 | diff --git a/lib/lp/registry/browser/mailinglists.py b/lib/lp/registry/browser/mailinglists.py |
1266 | index bbc26a2..be1e872 100644 |
1267 | --- a/lib/lp/registry/browser/mailinglists.py |
1268 | +++ b/lib/lp/registry/browser/mailinglists.py |
1269 | @@ -10,8 +10,8 @@ __all__ = [ |
1270 | |
1271 | |
1272 | from textwrap import TextWrapper |
1273 | +from urllib.parse import quote |
1274 | |
1275 | -from six.moves.urllib.parse import quote |
1276 | from zope.component import getUtility |
1277 | |
1278 | from lp.app.browser.tales import PersonFormatterAPI |
1279 | diff --git a/lib/lp/registry/browser/ociproject.py b/lib/lp/registry/browser/ociproject.py |
1280 | index 85a1c00..00e8024 100644 |
1281 | --- a/lib/lp/registry/browser/ociproject.py |
1282 | +++ b/lib/lp/registry/browser/ociproject.py |
1283 | @@ -12,11 +12,12 @@ __all__ = [ |
1284 | 'OCIProjectURL', |
1285 | ] |
1286 | |
1287 | -from breezy import urlutils |
1288 | -from six.moves.urllib.parse import ( |
1289 | +from urllib.parse import ( |
1290 | urlsplit, |
1291 | urlunsplit, |
1292 | ) |
1293 | + |
1294 | +from breezy import urlutils |
1295 | from zope.component import getUtility |
1296 | from zope.interface import implementer |
1297 | |
1298 | diff --git a/lib/lp/registry/browser/person.py b/lib/lp/registry/browser/person.py |
1299 | index ccd09c7..99526b7 100644 |
1300 | --- a/lib/lp/registry/browser/person.py |
1301 | +++ b/lib/lp/registry/browser/person.py |
1302 | @@ -57,6 +57,10 @@ from operator import ( |
1303 | itemgetter, |
1304 | ) |
1305 | from textwrap import dedent |
1306 | +from urllib.parse import ( |
1307 | + quote, |
1308 | + urlencode, |
1309 | + ) |
1310 | |
1311 | from lazr.config import as_timedelta |
1312 | from lazr.delegates import delegate_to |
1313 | @@ -65,10 +69,6 @@ from lazr.restful.interfaces import IWebServiceClientRequest |
1314 | from lazr.restful.utils import smartquote |
1315 | from lazr.uri import URI |
1316 | import pytz |
1317 | -from six.moves.urllib.parse import ( |
1318 | - quote, |
1319 | - urlencode, |
1320 | - ) |
1321 | from storm.zope.interfaces import IResultSet |
1322 | from zope.browserpage import ViewPageTemplateFile |
1323 | from zope.component import ( |
1324 | diff --git a/lib/lp/registry/browser/product.py b/lib/lp/registry/browser/product.py |
1325 | index faea1f8..9001fdb 100644 |
1326 | --- a/lib/lp/registry/browser/product.py |
1327 | +++ b/lib/lp/registry/browser/product.py |
1328 | @@ -40,6 +40,7 @@ __all__ = [ |
1329 | |
1330 | |
1331 | from operator import attrgetter |
1332 | +from urllib.parse import urlunsplit |
1333 | |
1334 | from breezy import urlutils |
1335 | from breezy.revision import NULL_REVISION |
1336 | @@ -49,7 +50,6 @@ from lazr.restful.interface import ( |
1337 | use_template, |
1338 | ) |
1339 | from lazr.restful.interfaces import IJSONRequestCache |
1340 | -from six.moves.urllib.parse import urlunsplit |
1341 | from zope.browserpage import ViewPageTemplateFile |
1342 | from zope.component import getUtility |
1343 | from zope.event import notify |
1344 | diff --git a/lib/lp/registry/browser/sourcepackage.py b/lib/lp/registry/browser/sourcepackage.py |
1345 | index 43e6fb7..6eb7d3b 100644 |
1346 | --- a/lib/lp/registry/browser/sourcepackage.py |
1347 | +++ b/lib/lp/registry/browser/sourcepackage.py |
1348 | @@ -16,6 +16,7 @@ __all__ = [ |
1349 | ] |
1350 | |
1351 | import string |
1352 | +from urllib.parse import urlencode |
1353 | |
1354 | from apt_pkg import ( |
1355 | upstream_version, |
1356 | @@ -26,7 +27,6 @@ from lazr.enum import ( |
1357 | Item, |
1358 | ) |
1359 | from lazr.restful.interface import copy_field |
1360 | -from six.moves.urllib.parse import urlencode |
1361 | from zope.browserpage import ViewPageTemplateFile |
1362 | from zope.component import ( |
1363 | adapter, |
1364 | diff --git a/lib/lp/registry/browser/team.py b/lib/lp/registry/browser/team.py |
1365 | index c37bbf0..c0e0be1 100644 |
1366 | --- a/lib/lp/registry/browser/team.py |
1367 | +++ b/lib/lp/registry/browser/team.py |
1368 | @@ -36,13 +36,13 @@ from datetime import ( |
1369 | timedelta, |
1370 | ) |
1371 | import math |
1372 | +from urllib.parse import unquote |
1373 | |
1374 | from lazr.restful.interface import copy_field |
1375 | from lazr.restful.interfaces import IJSONRequestCache |
1376 | from lazr.restful.utils import smartquote |
1377 | import pytz |
1378 | import simplejson |
1379 | -from six.moves.urllib.parse import unquote |
1380 | from zope.browserpage import ViewPageTemplateFile |
1381 | from zope.component import getUtility |
1382 | from zope.formlib.form import ( |
1383 | diff --git a/lib/lp/registry/browser/tests/test_distroseries.py b/lib/lp/registry/browser/tests/test_distroseries.py |
1384 | index 326bbfd..505d2aa 100644 |
1385 | --- a/lib/lp/registry/browser/tests/test_distroseries.py |
1386 | +++ b/lib/lp/registry/browser/tests/test_distroseries.py |
1387 | @@ -7,15 +7,15 @@ from datetime import timedelta |
1388 | import difflib |
1389 | import re |
1390 | from textwrap import TextWrapper |
1391 | +from urllib.parse import ( |
1392 | + urlencode, |
1393 | + urlparse, |
1394 | + ) |
1395 | |
1396 | from fixtures import FakeLogger |
1397 | from lazr.restful.interfaces import IJSONRequestCache |
1398 | from lxml import html |
1399 | import six |
1400 | -from six.moves.urllib.parse import ( |
1401 | - urlencode, |
1402 | - urlparse, |
1403 | - ) |
1404 | import soupmatchers |
1405 | from storm.zope.interfaces import IResultSet |
1406 | from testtools.content import ( |
1407 | diff --git a/lib/lp/registry/browser/tests/test_person.py b/lib/lp/registry/browser/tests/test_person.py |
1408 | index 1a1624f..2f5eb23 100644 |
1409 | --- a/lib/lp/registry/browser/tests/test_person.py |
1410 | +++ b/lib/lp/registry/browser/tests/test_person.py |
1411 | @@ -6,10 +6,10 @@ import email |
1412 | from operator import attrgetter |
1413 | import re |
1414 | from textwrap import dedent |
1415 | +from urllib.parse import urljoin |
1416 | |
1417 | from fixtures import FakeLogger |
1418 | import six |
1419 | -from six.moves.urllib.parse import urljoin |
1420 | import soupmatchers |
1421 | from storm.store import Store |
1422 | from testscenarios import ( |
1423 | diff --git a/lib/lp/registry/browser/tests/test_product.py b/lib/lp/registry/browser/tests/test_product.py |
1424 | index c79cbd1..fadb04a 100644 |
1425 | --- a/lib/lp/registry/browser/tests/test_product.py |
1426 | +++ b/lib/lp/registry/browser/tests/test_product.py |
1427 | @@ -7,16 +7,16 @@ __all__ = ['make_product_form'] |
1428 | |
1429 | import re |
1430 | from textwrap import dedent |
1431 | +from urllib.parse import ( |
1432 | + urlencode, |
1433 | + urlsplit, |
1434 | + ) |
1435 | |
1436 | from lazr.restful.fields import Reference |
1437 | from lazr.restful.interfaces import ( |
1438 | IFieldMarshaller, |
1439 | IJSONRequestCache, |
1440 | ) |
1441 | -from six.moves.urllib.parse import ( |
1442 | - urlencode, |
1443 | - urlsplit, |
1444 | - ) |
1445 | from soupmatchers import ( |
1446 | HTMLContains, |
1447 | Tag, |
1448 | diff --git a/lib/lp/registry/browser/tests/test_sourcepackage_views.py b/lib/lp/registry/browser/tests/test_sourcepackage_views.py |
1449 | index dcb66d0..2e4d2f7 100644 |
1450 | --- a/lib/lp/registry/browser/tests/test_sourcepackage_views.py |
1451 | +++ b/lib/lp/registry/browser/tests/test_sourcepackage_views.py |
1452 | @@ -3,10 +3,11 @@ |
1453 | |
1454 | """Tests for SourcePackage view code.""" |
1455 | |
1456 | -from six.moves.urllib.parse import ( |
1457 | +from urllib.parse import ( |
1458 | parse_qsl, |
1459 | splitquery, |
1460 | ) |
1461 | + |
1462 | from soupmatchers import ( |
1463 | HTMLContains, |
1464 | Tag, |
1465 | diff --git a/lib/lp/registry/scripts/distributionmirror_prober.py b/lib/lp/registry/scripts/distributionmirror_prober.py |
1466 | index acd384d..00e1389 100644 |
1467 | --- a/lib/lp/registry/scripts/distributionmirror_prober.py |
1468 | +++ b/lib/lp/registry/scripts/distributionmirror_prober.py |
1469 | @@ -11,6 +11,12 @@ import io |
1470 | import itertools |
1471 | import logging |
1472 | import os.path |
1473 | +from urllib.parse import ( |
1474 | + unquote, |
1475 | + urljoin, |
1476 | + urlparse, |
1477 | + urlunparse, |
1478 | + ) |
1479 | |
1480 | import OpenSSL |
1481 | from OpenSSL.SSL import ( |
1482 | @@ -19,12 +25,6 @@ from OpenSSL.SSL import ( |
1483 | ) |
1484 | import requests |
1485 | import six |
1486 | -from six.moves.urllib.parse import ( |
1487 | - unquote, |
1488 | - urljoin, |
1489 | - urlparse, |
1490 | - urlunparse, |
1491 | - ) |
1492 | from treq.client import HTTPClient as TreqHTTPClient |
1493 | from twisted.internet import ( |
1494 | defer, |
1495 | diff --git a/lib/lp/registry/scripts/productreleasefinder/finder.py b/lib/lp/registry/scripts/productreleasefinder/finder.py |
1496 | index df79137..5d51c0c 100644 |
1497 | --- a/lib/lp/registry/scripts/productreleasefinder/finder.py |
1498 | +++ b/lib/lp/registry/scripts/productreleasefinder/finder.py |
1499 | @@ -11,10 +11,10 @@ import mimetypes |
1500 | import os |
1501 | import re |
1502 | import tempfile |
1503 | +from urllib.parse import urlsplit |
1504 | |
1505 | import pytz |
1506 | import requests |
1507 | -from six.moves.urllib.parse import urlsplit |
1508 | from zope.component import getUtility |
1509 | |
1510 | from lp.app.validators.name import invalid_name_pattern |
1511 | diff --git a/lib/lp/registry/scripts/productreleasefinder/walker.py b/lib/lp/registry/scripts/productreleasefinder/walker.py |
1512 | index a7ee116..908dfd5 100644 |
1513 | --- a/lib/lp/registry/scripts/productreleasefinder/walker.py |
1514 | +++ b/lib/lp/registry/scripts/productreleasefinder/walker.py |
1515 | @@ -13,17 +13,17 @@ __all__ = [ |
1516 | |
1517 | import ftplib |
1518 | import os |
1519 | +from urllib.parse import ( |
1520 | + unquote_plus, |
1521 | + urljoin, |
1522 | + urlsplit, |
1523 | + ) |
1524 | |
1525 | from lazr.uri import ( |
1526 | InvalidURIError, |
1527 | URI, |
1528 | ) |
1529 | import requests |
1530 | -from six.moves.urllib.parse import ( |
1531 | - unquote_plus, |
1532 | - urljoin, |
1533 | - urlsplit, |
1534 | - ) |
1535 | |
1536 | from lp.registry.scripts.productreleasefinder import log |
1537 | from lp.registry.scripts.productreleasefinder.path import ( |
1538 | diff --git a/lib/lp/registry/stories/product/xx-product-files.txt b/lib/lp/registry/stories/product/xx-product-files.txt |
1539 | index cb82bc6..34dd7cd 100644 |
1540 | --- a/lib/lp/registry/stories/product/xx-product-files.txt |
1541 | +++ b/lib/lp/registry/stories/product/xx-product-files.txt |
1542 | @@ -401,8 +401,8 @@ Downloading and deleting files |
1543 | |
1544 | Download one of the files. |
1545 | |
1546 | - >>> from six.moves.urllib.parse import urlparse |
1547 | - >>> from six.moves.urllib.request import urlopen |
1548 | + >>> from urllib.parse import urlparse |
1549 | + >>> from urllib.request import urlopen |
1550 | |
1551 | XXX Downloading via the testbrowser does not work |
1552 | XXX unless the file is served by the Zope publisher. |
1553 | diff --git a/lib/lp/services/feeds/feed.py b/lib/lp/services/feeds/feed.py |
1554 | index 9798bc0..b7e1467 100644 |
1555 | --- a/lib/lp/services/feeds/feed.py |
1556 | +++ b/lib/lp/services/feeds/feed.py |
1557 | @@ -18,8 +18,8 @@ __all__ = [ |
1558 | import operator |
1559 | import os |
1560 | import time |
1561 | +from urllib.parse import urljoin |
1562 | |
1563 | -from six.moves.urllib.parse import urljoin |
1564 | from zope.browserpage import ViewPageTemplateFile |
1565 | from zope.component import getUtility |
1566 | from zope.datetime import rfc1123_date |
1567 | diff --git a/lib/lp/services/gpg/handler.py b/lib/lp/services/gpg/handler.py |
1568 | index 005ca79..7dd60c9 100644 |
1569 | --- a/lib/lp/services/gpg/handler.py |
1570 | +++ b/lib/lp/services/gpg/handler.py |
1571 | @@ -18,13 +18,13 @@ import shutil |
1572 | import subprocess |
1573 | import sys |
1574 | import tempfile |
1575 | +from urllib.parse import urlencode |
1576 | |
1577 | import gpgme |
1578 | from lazr.restful.utils import get_current_browser_request |
1579 | import pytz |
1580 | import requests |
1581 | import six |
1582 | -from six.moves.urllib.parse import urlencode |
1583 | from zope.component import getUtility |
1584 | from zope.interface import implementer |
1585 | from zope.security.proxy import removeSecurityProxy |
1586 | diff --git a/lib/lp/services/librarian/client.py b/lib/lp/services/librarian/client.py |
1587 | index a011bc3..0ef6028 100644 |
1588 | --- a/lib/lp/services/librarian/client.py |
1589 | +++ b/lib/lp/services/librarian/client.py |
1590 | @@ -21,20 +21,20 @@ from socket import ( |
1591 | ) |
1592 | import threading |
1593 | import time |
1594 | - |
1595 | -from lazr.restful.utils import get_current_browser_request |
1596 | -import six |
1597 | -from six.moves.urllib.error import ( |
1598 | +from urllib.error import ( |
1599 | HTTPError, |
1600 | URLError, |
1601 | ) |
1602 | -from six.moves.urllib.parse import ( |
1603 | +from urllib.parse import ( |
1604 | quote, |
1605 | urljoin, |
1606 | urlparse, |
1607 | urlunparse, |
1608 | ) |
1609 | -from six.moves.urllib.request import urlopen |
1610 | +from urllib.request import urlopen |
1611 | + |
1612 | +from lazr.restful.utils import get_current_browser_request |
1613 | +import six |
1614 | from storm.store import Store |
1615 | from zope.interface import implementer |
1616 | |
1617 | diff --git a/lib/lp/services/librarian/doc/librarian.txt b/lib/lp/services/librarian/doc/librarian.txt |
1618 | index 6c41957..b5c3daf 100644 |
1619 | --- a/lib/lp/services/librarian/doc/librarian.txt |
1620 | +++ b/lib/lp/services/librarian/doc/librarian.txt |
1621 | @@ -252,7 +252,7 @@ the client until it begins a new transaction. |
1622 | >>> print(url) |
1623 | http://.../text.txt |
1624 | |
1625 | - >>> from six.moves.urllib.request import urlopen |
1626 | + >>> from urllib.request import urlopen |
1627 | >>> six.ensure_str(urlopen(url).read()) |
1628 | 'This is some data' |
1629 | |
1630 | diff --git a/lib/lp/services/librarian/model.py b/lib/lp/services/librarian/model.py |
1631 | index 6b0ea19..bf27020 100644 |
1632 | --- a/lib/lp/services/librarian/model.py |
1633 | +++ b/lib/lp/services/librarian/model.py |
1634 | @@ -12,10 +12,10 @@ __all__ = [ |
1635 | |
1636 | from datetime import datetime |
1637 | import hashlib |
1638 | +from urllib.parse import urlparse |
1639 | |
1640 | from lazr.delegates import delegate_to |
1641 | import pytz |
1642 | -from six.moves.urllib.parse import urlparse |
1643 | from storm.locals import ( |
1644 | Date, |
1645 | Desc, |
1646 | diff --git a/lib/lp/services/librarian/smoketest.py b/lib/lp/services/librarian/smoketest.py |
1647 | index 5fd3a2b..8b4ba38 100644 |
1648 | --- a/lib/lp/services/librarian/smoketest.py |
1649 | +++ b/lib/lp/services/librarian/smoketest.py |
1650 | @@ -9,9 +9,9 @@ |
1651 | import datetime |
1652 | import io |
1653 | import sys |
1654 | +from urllib.request import urlopen |
1655 | |
1656 | import pytz |
1657 | -from six.moves.urllib.request import urlopen |
1658 | import transaction |
1659 | from zope.component import getUtility |
1660 | |
1661 | diff --git a/lib/lp/services/librarian/tests/test_client.py b/lib/lp/services/librarian/tests/test_client.py |
1662 | index 6bef538..2fef0cf 100644 |
1663 | --- a/lib/lp/services/librarian/tests/test_client.py |
1664 | +++ b/lib/lp/services/librarian/tests/test_client.py |
1665 | @@ -10,16 +10,16 @@ import socket |
1666 | import textwrap |
1667 | import threading |
1668 | import unittest |
1669 | +from urllib.error import ( |
1670 | + HTTPError, |
1671 | + URLError, |
1672 | + ) |
1673 | +from urllib.request import urlopen |
1674 | |
1675 | from fixtures import ( |
1676 | EnvironmentVariable, |
1677 | TempDir, |
1678 | ) |
1679 | -from six.moves.urllib.error import ( |
1680 | - HTTPError, |
1681 | - URLError, |
1682 | - ) |
1683 | -from six.moves.urllib.request import urlopen |
1684 | from testtools.testcase import ExpectedException |
1685 | import transaction |
1686 | |
1687 | diff --git a/lib/lp/services/librarianserver/db.py b/lib/lp/services/librarianserver/db.py |
1688 | index 4ed2901..3c0d9d0 100644 |
1689 | --- a/lib/lp/services/librarianserver/db.py |
1690 | +++ b/lib/lp/services/librarianserver/db.py |
1691 | @@ -8,13 +8,13 @@ __all__ = [ |
1692 | ] |
1693 | |
1694 | import hashlib |
1695 | -from xmlrpc.client import Fault |
1696 | - |
1697 | -from pymacaroons import Macaroon |
1698 | -from six.moves.urllib.parse import ( |
1699 | +from urllib.parse import ( |
1700 | quote, |
1701 | unquote, |
1702 | ) |
1703 | +from xmlrpc.client import Fault |
1704 | + |
1705 | +from pymacaroons import Macaroon |
1706 | from storm.expr import ( |
1707 | And, |
1708 | SQL, |
1709 | diff --git a/lib/lp/services/librarianserver/swift.py b/lib/lp/services/librarianserver/swift.py |
1710 | index bd22a1e..87bee7b 100644 |
1711 | --- a/lib/lp/services/librarianserver/swift.py |
1712 | +++ b/lib/lp/services/librarianserver/swift.py |
1713 | @@ -19,8 +19,8 @@ import hashlib |
1714 | import os.path |
1715 | import re |
1716 | import time |
1717 | +from urllib.parse import quote |
1718 | |
1719 | -from six.moves.urllib.parse import quote |
1720 | from swiftclient import client as swiftclient |
1721 | |
1722 | from lp.services.config import config |
1723 | diff --git a/lib/lp/services/librarianserver/testing/fake.py b/lib/lp/services/librarianserver/testing/fake.py |
1724 | index b18f9a9..59ed31b 100644 |
1725 | --- a/lib/lp/services/librarianserver/testing/fake.py |
1726 | +++ b/lib/lp/services/librarianserver/testing/fake.py |
1727 | @@ -16,9 +16,9 @@ __all__ = [ |
1728 | |
1729 | import hashlib |
1730 | import io |
1731 | +from urllib.parse import urljoin |
1732 | |
1733 | from fixtures import Fixture |
1734 | -from six.moves.urllib.parse import urljoin |
1735 | import transaction |
1736 | from transaction.interfaces import ISynchronizer |
1737 | import zope.component |
1738 | diff --git a/lib/lp/services/librarianserver/testing/tests/test_server_fixture.py b/lib/lp/services/librarianserver/testing/tests/test_server_fixture.py |
1739 | index 86a6619..bd617e9 100644 |
1740 | --- a/lib/lp/services/librarianserver/testing/tests/test_server_fixture.py |
1741 | +++ b/lib/lp/services/librarianserver/testing/tests/test_server_fixture.py |
1742 | @@ -6,8 +6,7 @@ |
1743 | import os |
1744 | import socket |
1745 | from textwrap import dedent |
1746 | - |
1747 | -from six.moves.urllib.request import urlopen |
1748 | +from urllib.request import urlopen |
1749 | |
1750 | from lp.services.config import config |
1751 | from lp.services.config.fixture import ConfigFixture |
1752 | diff --git a/lib/lp/services/librarianserver/tests/test_db_outage.py b/lib/lp/services/librarianserver/tests/test_db_outage.py |
1753 | index 5709cd9..7887632 100644 |
1754 | --- a/lib/lp/services/librarianserver/tests/test_db_outage.py |
1755 | +++ b/lib/lp/services/librarianserver/tests/test_db_outage.py |
1756 | @@ -6,10 +6,10 @@ |
1757 | Database outages happen by accident and during fastdowntime deployments.""" |
1758 | |
1759 | import io |
1760 | +from urllib.error import HTTPError |
1761 | +from urllib.request import urlopen |
1762 | |
1763 | from fixtures import Fixture |
1764 | -from six.moves.urllib.error import HTTPError |
1765 | -from six.moves.urllib.request import urlopen |
1766 | |
1767 | from lp.services.librarian.client import LibrarianClient |
1768 | from lp.services.librarianserver.testing.server import LibrarianServerFixture |
1769 | diff --git a/lib/lp/services/librarianserver/tests/test_gc.py b/lib/lp/services/librarianserver/tests/test_gc.py |
1770 | index 7e1eedb..850f9ae 100644 |
1771 | --- a/lib/lp/services/librarianserver/tests/test_gc.py |
1772 | +++ b/lib/lp/services/librarianserver/tests/test_gc.py |
1773 | @@ -19,11 +19,11 @@ from subprocess import ( |
1774 | STDOUT, |
1775 | ) |
1776 | import tempfile |
1777 | +from urllib.parse import urljoin |
1778 | |
1779 | from fixtures import MockPatchObject |
1780 | import pytz |
1781 | import requests |
1782 | -from six.moves.urllib.parse import urljoin |
1783 | from storm.store import Store |
1784 | from swiftclient import client as swiftclient |
1785 | from testtools.matchers import ( |
1786 | diff --git a/lib/lp/services/librarianserver/tests/test_web.py b/lib/lp/services/librarianserver/tests/test_web.py |
1787 | index 5800724..1fe9c22 100644 |
1788 | --- a/lib/lp/services/librarianserver/tests/test_web.py |
1789 | +++ b/lib/lp/services/librarianserver/tests/test_web.py |
1790 | @@ -8,11 +8,11 @@ import http.client |
1791 | from io import BytesIO |
1792 | import os |
1793 | import unittest |
1794 | +from urllib.parse import urlparse |
1795 | |
1796 | from lazr.uri import URI |
1797 | import pytz |
1798 | import requests |
1799 | -from six.moves.urllib.parse import urlparse |
1800 | from storm.expr import SQL |
1801 | from testtools.matchers import EndsWith |
1802 | import transaction |
1803 | diff --git a/lib/lp/services/librarianserver/web.py b/lib/lp/services/librarianserver/web.py |
1804 | index b40536f..989e043 100644 |
1805 | --- a/lib/lp/services/librarianserver/web.py |
1806 | +++ b/lib/lp/services/librarianserver/web.py |
1807 | @@ -3,10 +3,10 @@ |
1808 | |
1809 | from datetime import datetime |
1810 | import time |
1811 | +from urllib.parse import urlparse |
1812 | |
1813 | from pymacaroons import Macaroon |
1814 | import six |
1815 | -from six.moves.urllib.parse import urlparse |
1816 | from storm.exceptions import DisconnectionError |
1817 | from twisted.internet import ( |
1818 | abstract, |
1819 | diff --git a/lib/lp/services/oauth/stories/access-token.txt b/lib/lp/services/oauth/stories/access-token.txt |
1820 | index a56ee3c..86c5241 100644 |
1821 | --- a/lib/lp/services/oauth/stories/access-token.txt |
1822 | +++ b/lib/lp/services/oauth/stories/access-token.txt |
1823 | @@ -19,7 +19,7 @@ access token. |
1824 | >>> token.review(salgado, OAuthPermission.WRITE_PUBLIC) |
1825 | >>> logout() |
1826 | |
1827 | - >>> from six.moves.urllib.parse import urlencode |
1828 | + >>> from urllib.parse import urlencode |
1829 | >>> data = dict( |
1830 | ... oauth_consumer_key='foobar123451432', |
1831 | ... oauth_version='1.0', |
1832 | diff --git a/lib/lp/services/oauth/stories/authorize-token.txt b/lib/lp/services/oauth/stories/authorize-token.txt |
1833 | index 6634a7a..ecd2e7a 100644 |
1834 | --- a/lib/lp/services/oauth/stories/authorize-token.txt |
1835 | +++ b/lib/lp/services/oauth/stories/authorize-token.txt |
1836 | @@ -31,7 +31,7 @@ The +authorize-token page is restricted to logged in users, so users will |
1837 | first be asked to log in. (We won't show the actual login process because |
1838 | it involves OpenID, which would complicate this test quite a bit.) |
1839 | |
1840 | - >>> from six.moves.urllib.parse import urlencode |
1841 | + >>> from urllib.parse import urlencode |
1842 | >>> params = dict( |
1843 | ... oauth_token=token.key, oauth_callback='http://launchpad.test/bzr') |
1844 | >>> url = "http://launchpad.test/+authorize-token?%s" % urlencode(params) |
1845 | diff --git a/lib/lp/services/oauth/stories/request-token.txt b/lib/lp/services/oauth/stories/request-token.txt |
1846 | index 3e9b4cb..dc1b001 100644 |
1847 | --- a/lib/lp/services/oauth/stories/request-token.txt |
1848 | +++ b/lib/lp/services/oauth/stories/request-token.txt |
1849 | @@ -4,7 +4,7 @@ Asking for a request token |
1850 | Our sample consumer (whose key is 'foobar123451432') asks Launchpad for |
1851 | a request token which may later be exchanged for an access token. |
1852 | |
1853 | - >>> from six.moves.urllib.parse import urlencode |
1854 | + >>> from urllib.parse import urlencode |
1855 | >>> data = dict( |
1856 | ... oauth_consumer_key='foobar123451432', |
1857 | ... oauth_version='1.0', |
1858 | diff --git a/lib/lp/services/openid/fetcher.py b/lib/lp/services/openid/fetcher.py |
1859 | index 88343a1..a32e0f7 100644 |
1860 | --- a/lib/lp/services/openid/fetcher.py |
1861 | +++ b/lib/lp/services/openid/fetcher.py |
1862 | @@ -9,12 +9,12 @@ __all__ = [ |
1863 | |
1864 | from functools import partial |
1865 | import os.path |
1866 | +from urllib.request import urlopen |
1867 | |
1868 | from openid.fetchers import ( |
1869 | setDefaultFetcher, |
1870 | Urllib2Fetcher, |
1871 | ) |
1872 | -from six.moves.urllib.request import urlopen |
1873 | |
1874 | from lp.services.config import config |
1875 | from lp.services.encoding import wsgi_native_string |
1876 | diff --git a/lib/lp/services/scripts/base.py b/lib/lp/services/scripts/base.py |
1877 | index 9abdbb2..62dc799 100644 |
1878 | --- a/lib/lp/services/scripts/base.py |
1879 | +++ b/lib/lp/services/scripts/base.py |
1880 | @@ -19,6 +19,10 @@ import logging |
1881 | from optparse import OptionParser |
1882 | import os.path |
1883 | import sys |
1884 | +from urllib.parse import ( |
1885 | + urlparse, |
1886 | + urlunparse, |
1887 | + ) |
1888 | |
1889 | from contrib.glock import ( |
1890 | GlobalLock, |
1891 | @@ -26,10 +30,6 @@ from contrib.glock import ( |
1892 | ) |
1893 | import pytz |
1894 | import requests |
1895 | -from six.moves.urllib.parse import ( |
1896 | - urlparse, |
1897 | - urlunparse, |
1898 | - ) |
1899 | import transaction |
1900 | from zope.component import getUtility |
1901 | |
1902 | diff --git a/lib/lp/services/signing/proxy.py b/lib/lp/services/signing/proxy.py |
1903 | index 0e5fded..5bd23ba 100644 |
1904 | --- a/lib/lp/services/signing/proxy.py |
1905 | +++ b/lib/lp/services/signing/proxy.py |
1906 | @@ -5,6 +5,7 @@ |
1907 | |
1908 | import base64 |
1909 | import json |
1910 | +from urllib.parse import urljoin |
1911 | |
1912 | from lazr.restful.utils import get_current_browser_request |
1913 | from nacl.encoding import Base64Encoder |
1914 | @@ -14,7 +15,6 @@ from nacl.public import ( |
1915 | PublicKey, |
1916 | ) |
1917 | from nacl.utils import random |
1918 | -from six.moves.urllib.parse import urljoin |
1919 | from zope.interface import implementer |
1920 | |
1921 | from lp.services.config import config |
1922 | diff --git a/lib/lp/services/sitesearch/__init__.py b/lib/lp/services/sitesearch/__init__.py |
1923 | index 074c1a1..9c04b05 100644 |
1924 | --- a/lib/lp/services/sitesearch/__init__.py |
1925 | +++ b/lib/lp/services/sitesearch/__init__.py |
1926 | @@ -9,14 +9,15 @@ __all__ = [ |
1927 | 'PageMatches', |
1928 | ] |
1929 | |
1930 | -from lazr.restful.utils import get_current_browser_request |
1931 | -from lazr.uri import URI |
1932 | -import requests |
1933 | -from six.moves.urllib.parse import ( |
1934 | +from urllib.parse import ( |
1935 | parse_qsl, |
1936 | urlencode, |
1937 | urlunparse, |
1938 | ) |
1939 | + |
1940 | +from lazr.restful.utils import get_current_browser_request |
1941 | +from lazr.uri import URI |
1942 | +import requests |
1943 | from zope.interface import implementer |
1944 | |
1945 | from lp.services.config import config |
1946 | diff --git a/lib/lp/services/verification/browser/logintoken.py b/lib/lp/services/verification/browser/logintoken.py |
1947 | index 8d13422..a9004d4 100644 |
1948 | --- a/lib/lp/services/verification/browser/logintoken.py |
1949 | +++ b/lib/lp/services/verification/browser/logintoken.py |
1950 | @@ -13,10 +13,11 @@ __all__ = [ |
1951 | 'ValidateGPGKeyView', |
1952 | ] |
1953 | |
1954 | -from six.moves.urllib.parse import ( |
1955 | +from urllib.parse import ( |
1956 | urlencode, |
1957 | urljoin, |
1958 | ) |
1959 | + |
1960 | from zope.component import getUtility |
1961 | from zope.formlib.widget import CustomWidgetFactory |
1962 | from zope.formlib.widgets import TextAreaWidget |
1963 | diff --git a/lib/lp/services/webapp/doc/webapp-publication.txt b/lib/lp/services/webapp/doc/webapp-publication.txt |
1964 | index d7f8dcc..430ead9 100644 |
1965 | --- a/lib/lp/services/webapp/doc/webapp-publication.txt |
1966 | +++ b/lib/lp/services/webapp/doc/webapp-publication.txt |
1967 | @@ -507,7 +507,7 @@ python 'in' operator. |
1968 | |
1969 | >>> from lp.services.webapp.servers import ( |
1970 | ... LaunchpadBrowserRequest) |
1971 | - >>> from six.moves.urllib.parse import urlencode |
1972 | + >>> from urllib.parse import urlencode |
1973 | >>> environment = {'QUERY_STRING': urlencode({ |
1974 | ... 'a_field': 'a_value', |
1975 | ... 'items_field': [1, 2, 3]}, doseq=True)} |
1976 | diff --git a/lib/lp/services/webapp/errorlog.py b/lib/lp/services/webapp/errorlog.py |
1977 | index 7327c8f..82e698f 100644 |
1978 | --- a/lib/lp/services/webapp/errorlog.py |
1979 | +++ b/lib/lp/services/webapp/errorlog.py |
1980 | @@ -7,6 +7,7 @@ import contextlib |
1981 | from itertools import repeat |
1982 | import operator |
1983 | import re |
1984 | +from urllib.parse import urlparse |
1985 | |
1986 | from lazr.restful.utils import get_current_browser_request |
1987 | import oops.createhooks |
1988 | @@ -15,7 +16,6 @@ from oops_datedir_repo import DateDirRepo |
1989 | import oops_timeline |
1990 | import pytz |
1991 | import six |
1992 | -from six.moves.urllib.parse import urlparse |
1993 | from talisker.logs import logging_context |
1994 | from zope.component import getUtility |
1995 | from zope.error.interfaces import IErrorReportingUtility |
1996 | diff --git a/lib/lp/services/webapp/login.py b/lib/lp/services/webapp/login.py |
1997 | index 08e693a..0060ab7 100644 |
1998 | --- a/lib/lp/services/webapp/login.py |
1999 | +++ b/lib/lp/services/webapp/login.py |
2000 | @@ -6,6 +6,7 @@ from datetime import ( |
2001 | datetime, |
2002 | timedelta, |
2003 | ) |
2004 | +from urllib.parse import urlencode |
2005 | |
2006 | from openid.consumer.consumer import ( |
2007 | CANCEL, |
2008 | @@ -22,7 +23,6 @@ from paste.httpexceptions import ( |
2009 | HTTPException, |
2010 | ) |
2011 | import six |
2012 | -from six.moves.urllib.parse import urlencode |
2013 | import transaction |
2014 | from zope.authentication.interfaces import IUnauthenticatedPrincipal |
2015 | from zope.browserpage import ViewPageTemplateFile |
2016 | diff --git a/lib/lp/services/webapp/publication.py b/lib/lp/services/webapp/publication.py |
2017 | index 37cd383..6f2690d 100644 |
2018 | --- a/lib/lp/services/webapp/publication.py |
2019 | +++ b/lib/lp/services/webapp/publication.py |
2020 | @@ -11,13 +11,13 @@ import sys |
2021 | import threading |
2022 | import time |
2023 | import traceback |
2024 | +from urllib.parse import quote |
2025 | |
2026 | from lazr.uri import ( |
2027 | InvalidURIError, |
2028 | URI, |
2029 | ) |
2030 | from psycopg2.extensions import TransactionRollbackError |
2031 | -from six.moves.urllib.parse import quote |
2032 | from storm.database import STATE_DISCONNECTED |
2033 | from storm.exceptions import ( |
2034 | DisconnectionError, |
2035 | diff --git a/lib/lp/services/webapp/publisher.py b/lib/lp/services/webapp/publisher.py |
2036 | index 2f5960d..397c873 100644 |
2037 | --- a/lib/lp/services/webapp/publisher.py |
2038 | +++ b/lib/lp/services/webapp/publisher.py |
2039 | @@ -28,6 +28,7 @@ __all__ = [ |
2040 | from cgi import FieldStorage |
2041 | import http.client |
2042 | import re |
2043 | +from urllib.parse import urlparse |
2044 | from wsgiref.headers import Headers |
2045 | |
2046 | from lazr.restful import ( |
2047 | @@ -41,7 +42,6 @@ from lazr.restful.tales import WebLayerAPI |
2048 | from lazr.restful.utils import get_current_browser_request |
2049 | import simplejson |
2050 | import six |
2051 | -from six.moves.urllib.parse import urlparse |
2052 | from zope.app.publisher.xmlrpc import IMethodPublisher |
2053 | from zope.component import ( |
2054 | getUtility, |
2055 | diff --git a/lib/lp/services/webapp/servers.py b/lib/lp/services/webapp/servers.py |
2056 | index e644e05..79888bd 100644 |
2057 | --- a/lib/lp/services/webapp/servers.py |
2058 | +++ b/lib/lp/services/webapp/servers.py |
2059 | @@ -4,6 +4,7 @@ |
2060 | """Definition of the internet servers that Launchpad uses.""" |
2061 | |
2062 | import threading |
2063 | +from urllib.parse import parse_qs |
2064 | import xmlrpc.client |
2065 | |
2066 | from lazr.restful.interfaces import ( |
2067 | @@ -18,7 +19,6 @@ from lazr.restful.publisher import ( |
2068 | from lazr.restful.utils import get_current_browser_request |
2069 | from lazr.uri import URI |
2070 | import six |
2071 | -from six.moves.urllib.parse import parse_qs |
2072 | from talisker.logs import logging_context |
2073 | import transaction |
2074 | from transaction.interfaces import ISynchronizer |
2075 | diff --git a/lib/lp/services/webapp/tests/test_error.py b/lib/lp/services/webapp/tests/test_error.py |
2076 | index 2081b14..eae2756 100644 |
2077 | --- a/lib/lp/services/webapp/tests/test_error.py |
2078 | +++ b/lib/lp/services/webapp/tests/test_error.py |
2079 | @@ -7,10 +7,10 @@ import http.client |
2080 | import logging |
2081 | import socket |
2082 | import time |
2083 | +from urllib.error import HTTPError |
2084 | |
2085 | from fixtures import FakeLogger |
2086 | import psycopg2 |
2087 | -from six.moves.urllib.error import HTTPError |
2088 | from storm.exceptions import ( |
2089 | DisconnectionError, |
2090 | OperationalError, |
2091 | diff --git a/lib/lp/services/webapp/tests/test_login.py b/lib/lp/services/webapp/tests/test_login.py |
2092 | index 61357d4..1cfec2d 100644 |
2093 | --- a/lib/lp/services/webapp/tests/test_login.py |
2094 | +++ b/lib/lp/services/webapp/tests/test_login.py |
2095 | @@ -17,6 +17,12 @@ from datetime import ( |
2096 | ) |
2097 | import http.client |
2098 | import unittest |
2099 | +from urllib.error import HTTPError |
2100 | +from urllib.parse import ( |
2101 | + parse_qsl, |
2102 | + quote, |
2103 | + urlsplit, |
2104 | + ) |
2105 | |
2106 | from openid.consumer.consumer import ( |
2107 | FAILURE, |
2108 | @@ -27,12 +33,6 @@ from openid.extensions import ( |
2109 | sreg, |
2110 | ) |
2111 | from openid.yadis.discover import DiscoveryFailure |
2112 | -from six.moves.urllib.error import HTTPError |
2113 | -from six.moves.urllib.parse import ( |
2114 | - parse_qsl, |
2115 | - quote, |
2116 | - urlsplit, |
2117 | - ) |
2118 | from testtools.matchers import ( |
2119 | Contains, |
2120 | ContainsDict, |
2121 | diff --git a/lib/lp/services/webapp/tests/test_login_account.py b/lib/lp/services/webapp/tests/test_login_account.py |
2122 | index 6d6f535..550a7ae 100644 |
2123 | --- a/lib/lp/services/webapp/tests/test_login_account.py |
2124 | +++ b/lib/lp/services/webapp/tests/test_login_account.py |
2125 | @@ -2,9 +2,9 @@ |
2126 | # GNU Affero General Public License version 3 (see the file LICENSE). |
2127 | |
2128 | from datetime import datetime |
2129 | +from urllib.parse import parse_qs |
2130 | |
2131 | import lazr.uri |
2132 | -from six.moves.urllib.parse import parse_qs |
2133 | from zope.component import getUtility |
2134 | from zope.event import notify |
2135 | from zope.session.interfaces import ISession |
2136 | diff --git a/lib/lp/services/webapp/url.py b/lib/lp/services/webapp/url.py |
2137 | index a6f15b5..e3932d5 100644 |
2138 | --- a/lib/lp/services/webapp/url.py |
2139 | +++ b/lib/lp/services/webapp/url.py |
2140 | @@ -5,8 +5,8 @@ |
2141 | |
2142 | __all__ = ['urlappend', 'urlparse', 'urlsplit'] |
2143 | |
2144 | -import six.moves.urllib.parse as urlparse_module |
2145 | -from six.moves.urllib.parse import ( |
2146 | +import urllib.parse as urlparse_module |
2147 | +from urllib.parse import ( |
2148 | urljoin, |
2149 | urlparse as original_urlparse, |
2150 | urlsplit as original_urlsplit, |
2151 | diff --git a/lib/lp/services/webhooks/model.py b/lib/lp/services/webhooks/model.py |
2152 | index aed49ae..e8518db 100644 |
2153 | --- a/lib/lp/services/webhooks/model.py |
2154 | +++ b/lib/lp/services/webhooks/model.py |
2155 | @@ -15,6 +15,7 @@ from datetime import ( |
2156 | import ipaddress |
2157 | import re |
2158 | import socket |
2159 | +from urllib.parse import urlsplit |
2160 | |
2161 | import iso8601 |
2162 | from lazr.delegates import delegate_to |
2163 | @@ -24,7 +25,6 @@ from lazr.enum import ( |
2164 | ) |
2165 | import psutil |
2166 | from pytz import utc |
2167 | -from six.moves.urllib.parse import urlsplit |
2168 | from storm.expr import Desc |
2169 | from storm.properties import ( |
2170 | Bool, |
2171 | diff --git a/lib/lp/services/webservice/wadl.py b/lib/lp/services/webservice/wadl.py |
2172 | index 5432f26..bcbf3bf 100644 |
2173 | --- a/lib/lp/services/webservice/wadl.py |
2174 | +++ b/lib/lp/services/webservice/wadl.py |
2175 | @@ -7,9 +7,9 @@ try: |
2176 | from importlib import resources |
2177 | except ImportError: |
2178 | import importlib_resources as resources |
2179 | -import subprocess |
2180 | |
2181 | -from six.moves.urllib.parse import urljoin |
2182 | +import subprocess |
2183 | +from urllib.parse import urljoin |
2184 | |
2185 | from lp.services.webapp.interaction import ( |
2186 | ANONYMOUS, |
2187 | diff --git a/lib/lp/snappy/browser/snap.py b/lib/lp/snappy/browser/snap.py |
2188 | index 0fc63ca..eccbcd8 100644 |
2189 | --- a/lib/lp/snappy/browser/snap.py |
2190 | +++ b/lib/lp/snappy/browser/snap.py |
2191 | @@ -15,12 +15,13 @@ __all__ = [ |
2192 | 'SnapView', |
2193 | ] |
2194 | |
2195 | +from urllib.parse import urlencode |
2196 | + |
2197 | from lazr.restful.fields import Reference |
2198 | from lazr.restful.interface import ( |
2199 | copy_field, |
2200 | use_template, |
2201 | ) |
2202 | -from six.moves.urllib.parse import urlencode |
2203 | from zope.component import getUtility |
2204 | from zope.error.interfaces import IErrorReportingUtility |
2205 | from zope.formlib.widget import CustomWidgetFactory |
2206 | diff --git a/lib/lp/snappy/browser/tests/test_snap.py b/lib/lp/snappy/browser/tests/test_snap.py |
2207 | index c513111..bbc0be7 100644 |
2208 | --- a/lib/lp/snappy/browser/tests/test_snap.py |
2209 | +++ b/lib/lp/snappy/browser/tests/test_snap.py |
2210 | @@ -9,15 +9,15 @@ from datetime import ( |
2211 | ) |
2212 | import json |
2213 | import re |
2214 | +from urllib.parse import ( |
2215 | + parse_qs, |
2216 | + urlsplit, |
2217 | + ) |
2218 | |
2219 | from fixtures import FakeLogger |
2220 | from pymacaroons import Macaroon |
2221 | import pytz |
2222 | import responses |
2223 | -from six.moves.urllib.parse import ( |
2224 | - parse_qs, |
2225 | - urlsplit, |
2226 | - ) |
2227 | import soupmatchers |
2228 | from testtools.matchers import ( |
2229 | AfterPreprocessing, |
2230 | diff --git a/lib/lp/snappy/model/snap.py b/lib/lp/snappy/model/snap.py |
2231 | index 1a2bf68..16bbfed 100644 |
2232 | --- a/lib/lp/snappy/model/snap.py |
2233 | +++ b/lib/lp/snappy/model/snap.py |
2234 | @@ -13,13 +13,13 @@ from datetime import ( |
2235 | timedelta, |
2236 | ) |
2237 | from operator import attrgetter |
2238 | +from urllib.parse import urlsplit |
2239 | |
2240 | from breezy import urlutils |
2241 | from lazr.lifecycle.event import ObjectCreatedEvent |
2242 | from pymacaroons import Macaroon |
2243 | import pytz |
2244 | import six |
2245 | -from six.moves.urllib.parse import urlsplit |
2246 | from storm.expr import ( |
2247 | And, |
2248 | Coalesce, |
2249 | diff --git a/lib/lp/snappy/model/snapstoreclient.py b/lib/lp/snappy/model/snapstoreclient.py |
2250 | index e5900fc..b56f5b6 100644 |
2251 | --- a/lib/lp/snappy/model/snapstoreclient.py |
2252 | +++ b/lib/lp/snappy/model/snapstoreclient.py |
2253 | @@ -11,13 +11,13 @@ import base64 |
2254 | import json |
2255 | import string |
2256 | import time |
2257 | +from urllib.parse import urlsplit |
2258 | |
2259 | from lazr.restful.utils import get_current_browser_request |
2260 | from pymacaroons import Macaroon |
2261 | import requests |
2262 | from requests_toolbelt import MultipartEncoder |
2263 | import six |
2264 | -from six.moves.urllib.parse import urlsplit |
2265 | from zope.component import getUtility |
2266 | from zope.interface import implementer |
2267 | from zope.security.proxy import removeSecurityProxy |
2268 | diff --git a/lib/lp/snappy/tests/test_snap.py b/lib/lp/snappy/tests/test_snap.py |
2269 | index 7d8d45e..0dae2d5 100644 |
2270 | --- a/lib/lp/snappy/tests/test_snap.py |
2271 | +++ b/lib/lp/snappy/tests/test_snap.py |
2272 | @@ -11,6 +11,7 @@ from datetime import ( |
2273 | import json |
2274 | from operator import attrgetter |
2275 | from textwrap import dedent |
2276 | +from urllib.parse import urlsplit |
2277 | |
2278 | from fixtures import ( |
2279 | FakeLogger, |
2280 | @@ -21,7 +22,6 @@ from nacl.public import PrivateKey |
2281 | from pymacaroons import Macaroon |
2282 | import pytz |
2283 | import responses |
2284 | -from six.moves.urllib.parse import urlsplit |
2285 | from storm.exceptions import LostObjectError |
2286 | from storm.locals import Store |
2287 | from testtools.matchers import ( |
2288 | diff --git a/lib/lp/snappy/tests/test_snapbuild.py b/lib/lp/snappy/tests/test_snapbuild.py |
2289 | index 0cf70ac..f11a097 100644 |
2290 | --- a/lib/lp/snappy/tests/test_snapbuild.py |
2291 | +++ b/lib/lp/snappy/tests/test_snapbuild.py |
2292 | @@ -7,12 +7,12 @@ from datetime import ( |
2293 | datetime, |
2294 | timedelta, |
2295 | ) |
2296 | +from urllib.request import urlopen |
2297 | |
2298 | from fixtures import FakeLogger |
2299 | from pymacaroons import Macaroon |
2300 | import pytz |
2301 | import six |
2302 | -from six.moves.urllib.request import urlopen |
2303 | from testtools.matchers import ( |
2304 | ContainsDict, |
2305 | Equals, |
2306 | diff --git a/lib/lp/snappy/tests/test_snapbuildbehaviour.py b/lib/lp/snappy/tests/test_snapbuildbehaviour.py |
2307 | index d1836e1..db202cb 100644 |
2308 | --- a/lib/lp/snappy/tests/test_snapbuildbehaviour.py |
2309 | +++ b/lib/lp/snappy/tests/test_snapbuildbehaviour.py |
2310 | @@ -8,13 +8,13 @@ from datetime import datetime |
2311 | import os.path |
2312 | from textwrap import dedent |
2313 | import time |
2314 | +from urllib.parse import urlsplit |
2315 | import uuid |
2316 | |
2317 | from aptsources.sourceslist import SourceEntry |
2318 | import fixtures |
2319 | from pymacaroons import Macaroon |
2320 | import pytz |
2321 | -from six.moves.urllib_parse import urlsplit |
2322 | from testtools import ExpectedException |
2323 | from testtools.matchers import ( |
2324 | AfterPreprocessing, |
2325 | diff --git a/lib/lp/soyuz/browser/widgets/archive.py b/lib/lp/soyuz/browser/widgets/archive.py |
2326 | index 17d0947..73a279f 100644 |
2327 | --- a/lib/lp/soyuz/browser/widgets/archive.py |
2328 | +++ b/lib/lp/soyuz/browser/widgets/archive.py |
2329 | @@ -7,7 +7,7 @@ __all__ = [ |
2330 | 'PPANameWidget', |
2331 | ] |
2332 | |
2333 | -from six.moves.urllib.parse import urljoin |
2334 | +from urllib.parse import urljoin |
2335 | |
2336 | from lp.app.widgets.textwidgets import URIComponentWidget |
2337 | from lp.services.config import config |
2338 | diff --git a/lib/lp/soyuz/interfaces/archive.py b/lib/lp/soyuz/interfaces/archive.py |
2339 | index da4b948..e011591 100644 |
2340 | --- a/lib/lp/soyuz/interfaces/archive.py |
2341 | +++ b/lib/lp/soyuz/interfaces/archive.py |
2342 | @@ -54,6 +54,7 @@ __all__ = [ |
2343 | |
2344 | import http.client |
2345 | import re |
2346 | +from urllib.parse import urlparse |
2347 | |
2348 | from lazr.restful.declarations import ( |
2349 | call_with, |
2350 | @@ -78,7 +79,6 @@ from lazr.restful.fields import ( |
2351 | CollectionField, |
2352 | Reference, |
2353 | ) |
2354 | -from six.moves.urllib.parse import urlparse |
2355 | from zope.interface import ( |
2356 | Attribute, |
2357 | Interface, |
2358 | diff --git a/lib/lp/soyuz/scripts/ppa_apache_log_parser.py b/lib/lp/soyuz/scripts/ppa_apache_log_parser.py |
2359 | index 64bfcd1..c8c1e58 100644 |
2360 | --- a/lib/lp/soyuz/scripts/ppa_apache_log_parser.py |
2361 | +++ b/lib/lp/soyuz/scripts/ppa_apache_log_parser.py |
2362 | @@ -4,8 +4,7 @@ |
2363 | __all__ = ['DBUSER', 'get_ppa_file_key'] |
2364 | |
2365 | import os.path |
2366 | - |
2367 | -from six.moves.urllib.parse import unquote |
2368 | +from urllib.parse import unquote |
2369 | |
2370 | from lp.archiveuploader.utils import re_isadeb |
2371 | |
2372 | diff --git a/lib/lp/soyuz/tests/test_archive.py b/lib/lp/soyuz/tests/test_archive.py |
2373 | index cbc40ac..a02d75d 100644 |
2374 | --- a/lib/lp/soyuz/tests/test_archive.py |
2375 | +++ b/lib/lp/soyuz/tests/test_archive.py |
2376 | @@ -11,11 +11,11 @@ from datetime import ( |
2377 | import doctest |
2378 | import http.client |
2379 | import os.path |
2380 | +from urllib.parse import urlsplit |
2381 | |
2382 | from aptsources.sourceslist import SourceEntry |
2383 | from pytz import UTC |
2384 | import responses |
2385 | -from six.moves.urllib.parse import urlsplit |
2386 | from storm.store import Store |
2387 | from testtools.matchers import ( |
2388 | AfterPreprocessing, |
2389 | diff --git a/lib/lp/soyuz/tests/test_livefsbuild.py b/lib/lp/soyuz/tests/test_livefsbuild.py |
2390 | index d448344..f642bcd 100644 |
2391 | --- a/lib/lp/soyuz/tests/test_livefsbuild.py |
2392 | +++ b/lib/lp/soyuz/tests/test_livefsbuild.py |
2393 | @@ -7,12 +7,12 @@ from datetime import ( |
2394 | datetime, |
2395 | timedelta, |
2396 | ) |
2397 | +from urllib.parse import urlsplit |
2398 | +from urllib.request import urlopen |
2399 | |
2400 | from fixtures import FakeLogger |
2401 | from pymacaroons import Macaroon |
2402 | import pytz |
2403 | -from six.moves.urllib.parse import urlsplit |
2404 | -from six.moves.urllib.request import urlopen |
2405 | from testtools.matchers import ( |
2406 | ContainsDict, |
2407 | Equals, |
2408 | diff --git a/lib/lp/soyuz/tests/test_packageupload.py b/lib/lp/soyuz/tests/test_packageupload.py |
2409 | index 24d21ca..3e88b0e 100644 |
2410 | --- a/lib/lp/soyuz/tests/test_packageupload.py |
2411 | +++ b/lib/lp/soyuz/tests/test_packageupload.py |
2412 | @@ -7,13 +7,13 @@ from datetime import timedelta |
2413 | import io |
2414 | import os.path |
2415 | import shutil |
2416 | +from urllib.request import urlopen |
2417 | |
2418 | from debian.deb822 import Changes |
2419 | from lazr.restfulclient.errors import ( |
2420 | BadRequest, |
2421 | Unauthorized, |
2422 | ) |
2423 | -from six.moves.urllib.request import urlopen |
2424 | from testtools.matchers import ( |
2425 | Equals, |
2426 | MatchesListwise, |
2427 | diff --git a/lib/lp/testing/keyserver/tests/test_harness.py b/lib/lp/testing/keyserver/tests/test_harness.py |
2428 | index 18b5ac0..e0727f4 100644 |
2429 | --- a/lib/lp/testing/keyserver/tests/test_harness.py |
2430 | +++ b/lib/lp/testing/keyserver/tests/test_harness.py |
2431 | @@ -1,7 +1,7 @@ |
2432 | # Copyright 2009-2011 Canonical Ltd. This software is licensed under the |
2433 | # GNU Affero General Public License version 3 (see the file LICENSE). |
2434 | |
2435 | -from six.moves.urllib.request import urlopen |
2436 | +from urllib.request import urlopen |
2437 | |
2438 | from lp.services.config import config |
2439 | from lp.testing import TestCase |
2440 | diff --git a/lib/lp/testing/layers.py b/lib/lp/testing/layers.py |
2441 | index 94c5dcd..6af3146 100644 |
2442 | --- a/lib/lp/testing/layers.py |
2443 | +++ b/lib/lp/testing/layers.py |
2444 | @@ -65,6 +65,12 @@ from unittest import ( |
2445 | TestCase, |
2446 | TestResult, |
2447 | ) |
2448 | +from urllib.error import ( |
2449 | + HTTPError, |
2450 | + URLError, |
2451 | + ) |
2452 | +from urllib.parse import urlparse |
2453 | +from urllib.request import urlopen |
2454 | |
2455 | from fixtures import ( |
2456 | Fixture, |
2457 | @@ -73,12 +79,6 @@ from fixtures import ( |
2458 | import psycopg2 |
2459 | from requests import Session |
2460 | from requests.adapters import HTTPAdapter |
2461 | -from six.moves.urllib.error import ( |
2462 | - HTTPError, |
2463 | - URLError, |
2464 | - ) |
2465 | -from six.moves.urllib.parse import urlparse |
2466 | -from six.moves.urllib.request import urlopen |
2467 | from storm.uri import URI |
2468 | from talisker.context import Context |
2469 | import transaction |
2470 | diff --git a/lib/lp/testing/pages.py b/lib/lp/testing/pages.py |
2471 | index 0772e0c..c706ab8 100644 |
2472 | --- a/lib/lp/testing/pages.py |
2473 | +++ b/lib/lp/testing/pages.py |
2474 | @@ -11,6 +11,7 @@ from itertools import chain |
2475 | import os |
2476 | import re |
2477 | import unittest |
2478 | +from urllib.parse import urljoin |
2479 | |
2480 | from bs4.element import ( |
2481 | CData, |
2482 | @@ -25,7 +26,6 @@ from bs4.element import ( |
2483 | from lazr.restful.testing.webservice import WebServiceCaller |
2484 | from oauthlib import oauth1 |
2485 | import six |
2486 | -from six.moves.urllib.parse import urljoin |
2487 | from soupsieve import escape as css_escape |
2488 | import transaction |
2489 | from webtest import TestRequest |
2490 | diff --git a/lib/lp/testing/publication.py b/lib/lp/testing/publication.py |
2491 | index 74b350f..a0f6d55 100644 |
2492 | --- a/lib/lp/testing/publication.py |
2493 | +++ b/lib/lp/testing/publication.py |
2494 | @@ -10,11 +10,11 @@ __all__ = [ |
2495 | ] |
2496 | |
2497 | import io |
2498 | - |
2499 | -from six.moves.urllib_parse import ( |
2500 | +from urllib.parse import ( |
2501 | unquote, |
2502 | urljoin, |
2503 | ) |
2504 | + |
2505 | from zope.app.publication.requestpublicationregistry import factoryRegistry |
2506 | from zope.authentication.interfaces import IUnauthenticatedPrincipal |
2507 | from zope.component import ( |
2508 | diff --git a/lib/lp/testing/tests/test_layers_functional.py b/lib/lp/testing/tests/test_layers_functional.py |
2509 | index 212701a..0a665dc 100644 |
2510 | --- a/lib/lp/testing/tests/test_layers_functional.py |
2511 | +++ b/lib/lp/testing/tests/test_layers_functional.py |
2512 | @@ -10,6 +10,8 @@ to confirm that the environment hasn't been corrupted by tests |
2513 | import io |
2514 | import os |
2515 | import signal |
2516 | +from urllib.error import HTTPError |
2517 | +from urllib.request import urlopen |
2518 | |
2519 | import amqp |
2520 | from fixtures import ( |
2521 | @@ -18,8 +20,6 @@ from fixtures import ( |
2522 | TestWithFixtures, |
2523 | ) |
2524 | import six |
2525 | -from six.moves.urllib.error import HTTPError |
2526 | -from six.moves.urllib.request import urlopen |
2527 | from zope.component import getUtility |
2528 | from zope.interface.interfaces import ComponentLookupError |
2529 | |
2530 | diff --git a/lib/lp/testing/tests/test_publication.py b/lib/lp/testing/tests/test_publication.py |
2531 | index 606ae31..a748c39 100644 |
2532 | --- a/lib/lp/testing/tests/test_publication.py |
2533 | +++ b/lib/lp/testing/tests/test_publication.py |
2534 | @@ -3,9 +3,10 @@ |
2535 | |
2536 | """Tests for the helpers in `lp.testing.publication`.""" |
2537 | |
2538 | +from urllib.parse import quote |
2539 | + |
2540 | from lazr.restful import EntryResource |
2541 | from lazr.restful.utils import get_current_browser_request |
2542 | -from six.moves.urllib_parse import quote |
2543 | from zope.browserpage.simpleviewclass import simple |
2544 | from zope.component import ( |
2545 | getSiteManager, |
2546 | diff --git a/lib/lp/testopenid/stories/basics.txt b/lib/lp/testopenid/stories/basics.txt |
2547 | index 380bb7d..0543953 100644 |
2548 | --- a/lib/lp/testopenid/stories/basics.txt |
2549 | +++ b/lib/lp/testopenid/stories/basics.txt |
2550 | @@ -29,7 +29,7 @@ After determining the URL of the OpenID server, the next thing a consumer |
2551 | needs to do is associate with the server and get a shared secret via a |
2552 | POST request. |
2553 | |
2554 | - >>> from six.moves.urllib.parse import urlencode |
2555 | + >>> from urllib.parse import urlencode |
2556 | >>> anon_browser.open( |
2557 | ... 'http://testopenid.test/+openid', data=urlencode({ |
2558 | ... 'openid.mode': 'associate', |
2559 | diff --git a/lib/lp/testopenid/testing/helpers.py b/lib/lp/testopenid/testing/helpers.py |
2560 | index 4d189e4..bcbe038 100644 |
2561 | --- a/lib/lp/testopenid/testing/helpers.py |
2562 | +++ b/lib/lp/testopenid/testing/helpers.py |
2563 | @@ -11,13 +11,13 @@ __all__ = [ |
2564 | ] |
2565 | |
2566 | import io |
2567 | +from urllib.error import HTTPError |
2568 | |
2569 | from openid import fetchers |
2570 | from openid.consumer.discover import ( |
2571 | OPENID_IDP_2_0_TYPE, |
2572 | OpenIDServiceEndpoint, |
2573 | ) |
2574 | -from six.moves.urllib.error import HTTPError |
2575 | from zope.testbrowser.wsgi import Browser |
2576 | |
2577 | from lp.services.encoding import wsgi_native_string |
2578 | diff --git a/lib/lp/translations/browser/person.py b/lib/lp/translations/browser/person.py |
2579 | index 2dd8d81..ec90dde 100644 |
2580 | --- a/lib/lp/translations/browser/person.py |
2581 | +++ b/lib/lp/translations/browser/person.py |
2582 | @@ -14,9 +14,9 @@ from datetime import ( |
2583 | timedelta, |
2584 | ) |
2585 | from itertools import islice |
2586 | +from urllib.parse import urlencode |
2587 | |
2588 | import pytz |
2589 | -from six.moves.urllib.parse import urlencode |
2590 | from zope.browserpage import ViewPageTemplateFile |
2591 | from zope.component import getUtility |
2592 | from zope.formlib.widget import CustomWidgetFactory |
2593 | diff --git a/lib/lp/translations/browser/pofile.py b/lib/lp/translations/browser/pofile.py |
2594 | index 1e85b3e..e636631 100644 |
2595 | --- a/lib/lp/translations/browser/pofile.py |
2596 | +++ b/lib/lp/translations/browser/pofile.py |
2597 | @@ -15,10 +15,10 @@ __all__ = [ |
2598 | |
2599 | import os.path |
2600 | import re |
2601 | +from urllib.parse import urlencode |
2602 | |
2603 | from lazr.restful.utils import smartquote |
2604 | import six |
2605 | -from six.moves.urllib.parse import urlencode |
2606 | from zope.component import getUtility |
2607 | from zope.publisher.browser import FileUpload |
2608 | |
2609 | diff --git a/lib/lp/translations/browser/tests/test_persontranslationview.py b/lib/lp/translations/browser/tests/test_persontranslationview.py |
2610 | index e3c1251..aa0d873 100644 |
2611 | --- a/lib/lp/translations/browser/tests/test_persontranslationview.py |
2612 | +++ b/lib/lp/translations/browser/tests/test_persontranslationview.py |
2613 | @@ -1,7 +1,8 @@ |
2614 | # Copyright 2009-2018 Canonical Ltd. This software is licensed under the |
2615 | # GNU Affero General Public License version 3 (see the file LICENSE). |
2616 | |
2617 | -from six.moves.urllib.parse import urlencode |
2618 | +from urllib.parse import urlencode |
2619 | + |
2620 | from zope.security.proxy import removeSecurityProxy |
2621 | |
2622 | from lp.app.enums import ServiceUsage |
2623 | diff --git a/lib/lp/translations/browser/translationmessage.py b/lib/lp/translations/browser/translationmessage.py |
2624 | index 4f904d9..105ad46 100644 |
2625 | --- a/lib/lp/translations/browser/translationmessage.py |
2626 | +++ b/lib/lp/translations/browser/translationmessage.py |
2627 | @@ -19,12 +19,12 @@ __all__ = [ |
2628 | import datetime |
2629 | import operator |
2630 | import re |
2631 | - |
2632 | -import pytz |
2633 | -from six.moves.urllib.parse import ( |
2634 | +from urllib.parse import ( |
2635 | parse_qsl, |
2636 | urlencode, |
2637 | ) |
2638 | + |
2639 | +import pytz |
2640 | from zope import datetime as zope_datetime |
2641 | from zope.browserpage import ViewPageTemplateFile |
2642 | from zope.component import getUtility |
2643 | diff --git a/lib/lp/translations/doc/poexport-request-productseries.txt b/lib/lp/translations/doc/poexport-request-productseries.txt |
2644 | index a762411..45aa763 100644 |
2645 | --- a/lib/lp/translations/doc/poexport-request-productseries.txt |
2646 | +++ b/lib/lp/translations/doc/poexport-request-productseries.txt |
2647 | @@ -84,7 +84,7 @@ The email contains a URL linking to where the exported file can be downloaded. |
2648 | |
2649 | Let's download it and make sure the contents look ok. |
2650 | |
2651 | - >>> from six.moves.urllib.request import urlopen |
2652 | + >>> from urllib.request import urlopen |
2653 | >>> from lp.services.helpers import bytes_to_tarfile |
2654 | >>> tarball = bytes_to_tarfile(urlopen(url).read()) |
2655 | >>> for name in sorted(tarball.getnames()): |
2656 | diff --git a/lib/lp/translations/doc/poexport-request.txt b/lib/lp/translations/doc/poexport-request.txt |
2657 | index 18d685d..5aee787 100644 |
2658 | --- a/lib/lp/translations/doc/poexport-request.txt |
2659 | +++ b/lib/lp/translations/doc/poexport-request.txt |
2660 | @@ -85,7 +85,7 @@ The email contains a URL linking to where the exported file can be downloaded. |
2661 | |
2662 | Let's download it and make sure the contents look ok. |
2663 | |
2664 | - >>> from six.moves.urllib.request import urlopen |
2665 | + >>> from urllib.request import urlopen |
2666 | >>> from lp.services.helpers import bytes_to_tarfile |
2667 | >>> tarball = bytes_to_tarfile(urlopen(url).read()) |
2668 | >>> for name in sorted(tarball.getnames()): |
2669 | diff --git a/lib/lp/translations/stories/importqueue/xx-translation-import-queue.txt b/lib/lp/translations/stories/importqueue/xx-translation-import-queue.txt |
2670 | index 0dcbd93..2279d03 100644 |
2671 | --- a/lib/lp/translations/stories/importqueue/xx-translation-import-queue.txt |
2672 | +++ b/lib/lp/translations/stories/importqueue/xx-translation-import-queue.txt |
2673 | @@ -209,7 +209,7 @@ There is an option to remove entries from the queue. |
2674 | |
2675 | No Privileges Person tries to remove entries but to no effect. |
2676 | |
2677 | - >>> from six.moves.urllib.parse import urlencode |
2678 | + >>> from urllib.parse import urlencode |
2679 | >>> post_data = urlencode( |
2680 | ... { |
2681 | ... 'field.filter_target': 'all', |
2682 | diff --git a/utilities/paste b/utilities/paste |
2683 | index 2787a3a..fa461f0 100755 |
2684 | --- a/utilities/paste |
2685 | +++ b/utilities/paste |
2686 | @@ -9,11 +9,11 @@ from optparse import OptionParser |
2687 | import os |
2688 | import pwd |
2689 | import sys |
2690 | +from urllib.parse import urljoin |
2691 | import webbrowser |
2692 | |
2693 | from fixtures import MonkeyPatch |
2694 | from six.moves.http_cookiejar import Cookie |
2695 | -from six.moves.urllib.parse import urljoin |
2696 | from zope.testbrowser.browser import Browser |
2697 | |
2698 | |
2699 | @@ -118,8 +118,7 @@ def main(): |
2700 | # Remove the check for robots.txt, since the one on |
2701 | # pastebin.ubuntu.com doesn't allow us to open the page. We're not |
2702 | # really a robot. |
2703 | - with MonkeyPatch( |
2704 | - 'six.moves.urllib.robotparser.RobotFileParser.allow_all', True): |
2705 | + with MonkeyPatch('urllib.robotparser.RobotFileParser.allow_all', True): |
2706 | browser.open(urljoin('https://' + paste_host, PASTE_PATH)) |
2707 | |
2708 | if parser.options.private: |
2709 | diff --git a/utilities/roundup-sniffer.py b/utilities/roundup-sniffer.py |
2710 | index 5fbfb26..16bebbe 100755 |
2711 | --- a/utilities/roundup-sniffer.py |
2712 | +++ b/utilities/roundup-sniffer.py |
2713 | @@ -44,9 +44,8 @@ from os.path import ( |
2714 | from pprint import pprint |
2715 | import sys |
2716 | from time import sleep |
2717 | - |
2718 | -from six.moves.urllib.parse import urlencode |
2719 | -from six.moves.urllib.request import urlopen |
2720 | +from urllib.parse import urlencode |
2721 | +from urllib.request import urlopen |
2722 | |
2723 | from lp.services.beautifulsoup import BeautifulSoup |
2724 |
LGTM 👍. I have left one minor suggestion.