Merge ~cjwatson/launchpad:py3only-urllib-imports into launchpad: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)
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
Guruprasad (lgp171188) wrote :

LGTM 👍. I have left one minor suggestion.

review: Approve
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
diff --git a/lib/launchpad_loggerhead/app.py b/lib/launchpad_loggerhead/app.py
index 3e693f2..7697cc9 100644
--- a/lib/launchpad_loggerhead/app.py
+++ b/lib/launchpad_loggerhead/app.py
@@ -4,6 +4,10 @@
4import logging4import logging
5import os5import os
6import threading6import threading
7from urllib.parse import (
8 urlencode,
9 urljoin,
10 )
7import xmlrpc.client11import xmlrpc.client
812
9from breezy import (13from breezy import (
@@ -40,10 +44,6 @@ from paste.request import (
40 parse_querystring,44 parse_querystring,
41 path_info_pop,45 path_info_pop,
42 )46 )
43from six.moves.urllib.parse import (
44 urlencode,
45 urljoin,
46 )
4747
48from lp.code.interfaces.codehosting import (48from lp.code.interfaces.codehosting import (
49 BRANCH_TRANSPORT,49 BRANCH_TRANSPORT,
diff --git a/lib/launchpad_loggerhead/tests.py b/lib/launchpad_loggerhead/tests.py
index cad2ec3..52cd884 100644
--- a/lib/launchpad_loggerhead/tests.py
+++ b/lib/launchpad_loggerhead/tests.py
@@ -1,12 +1,13 @@
1# Copyright 2010-2018 Canonical Ltd. This software is licensed under the1# Copyright 2010-2018 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4from paste.httpexceptions import HTTPExceptionHandler4from urllib.parse import (
5import requests
6from six.moves.urllib_parse import (
7 urlencode,5 urlencode,
8 urlsplit,6 urlsplit,
9 )7 )
8
9from paste.httpexceptions import HTTPExceptionHandler
10import requests
10import soupmatchers11import soupmatchers
11from testtools.content import Content12from testtools.content import Content
12from testtools.content_type import UTF8_TEXT13from testtools.content_type import UTF8_TEXT
diff --git a/lib/lp/answers/browser/faqcollection.py b/lib/lp/answers/browser/faqcollection.py
index a32ebca..a2fb420 100644
--- a/lib/lp/answers/browser/faqcollection.py
+++ b/lib/lp/answers/browser/faqcollection.py
@@ -8,7 +8,7 @@ __all__ = [
8 'SearchFAQsView',8 'SearchFAQsView',
9 ]9 ]
1010
11from six.moves.urllib.parse import urlencode11from urllib.parse import urlencode
1212
13from lp import _13from lp import _
14from lp.answers.enums import (14from lp.answers.enums import (
diff --git a/lib/lp/answers/browser/questiontarget.py b/lib/lp/answers/browser/questiontarget.py
index 57d8caa..5eb0c08 100644
--- a/lib/lp/answers/browser/questiontarget.py
+++ b/lib/lp/answers/browser/questiontarget.py
@@ -19,13 +19,13 @@ __all__ = [
19 ]19 ]
2020
21from operator import attrgetter21from operator import attrgetter
22from urllib.parse import urlencode
2223
23from lazr.restful.interfaces import (24from lazr.restful.interfaces import (
24 IJSONRequestCache,25 IJSONRequestCache,
25 IWebServiceClientRequest,26 IWebServiceClientRequest,
26 )27 )
27from simplejson import dumps28from simplejson import dumps
28from six.moves.urllib.parse import urlencode
29from zope.browserpage import ViewPageTemplateFile29from zope.browserpage import ViewPageTemplateFile
30from zope.component import (30from zope.component import (
31 getMultiAdapter,31 getMultiAdapter,
diff --git a/lib/lp/answers/browser/tests/test_questiontarget.py b/lib/lp/answers/browser/tests/test_questiontarget.py
index 307d038..386846f 100644
--- a/lib/lp/answers/browser/tests/test_questiontarget.py
+++ b/lib/lp/answers/browser/tests/test_questiontarget.py
@@ -5,12 +5,12 @@
55
6import json6import json
7import os7import os
8from urllib.parse import quote
89
9from lazr.restful.interfaces import (10from lazr.restful.interfaces import (
10 IJSONRequestCache,11 IJSONRequestCache,
11 IWebServiceClientRequest,12 IWebServiceClientRequest,
12 )13 )
13from six.moves.urllib.parse import quote
14from zope.component import getUtility14from zope.component import getUtility
15from zope.security.proxy import removeSecurityProxy15from zope.security.proxy import removeSecurityProxy
16from zope.traversing.browser import absoluteURL16from zope.traversing.browser import absoluteURL
diff --git a/lib/lp/app/browser/launchpad.py b/lib/lp/app/browser/launchpad.py
index 110a34a..c887a24 100644
--- a/lib/lp/app/browser/launchpad.py
+++ b/lib/lp/app/browser/launchpad.py
@@ -26,11 +26,11 @@ import operator
26import os26import os
27import re27import re
28import time28import time
2929from urllib.parse import (
30from six.moves.urllib.parse import (
31 parse_qs,30 parse_qs,
32 urlencode,31 urlencode,
33 )32 )
33
34from zope import i18n34from zope import i18n
35from zope.component import (35from zope.component import (
36 getGlobalSiteManager,36 getGlobalSiteManager,
diff --git a/lib/lp/app/browser/tales.py b/lib/lp/app/browser/tales.py
index 304fb1b..cfe0af0 100644
--- a/lib/lp/app/browser/tales.py
+++ b/lib/lp/app/browser/tales.py
@@ -16,12 +16,12 @@ import math
16import os.path16import os.path
17import sys17import sys
18from textwrap import dedent18from textwrap import dedent
19from urllib.parse import quote
1920
20from lazr.enum import enumerated_type_registry21from lazr.enum import enumerated_type_registry
21from lazr.restful.utils import get_current_browser_request22from lazr.restful.utils import get_current_browser_request
22from lazr.uri import URI23from lazr.uri import URI
23import pytz24import pytz
24from six.moves.urllib.parse import quote
25from zope.browserpage import ViewPageTemplateFile25from zope.browserpage import ViewPageTemplateFile
26from zope.component import (26from zope.component import (
27 adapter,27 adapter,
diff --git a/lib/lp/app/browser/tests/test_vocabulary.py b/lib/lp/app/browser/tests/test_vocabulary.py
index 644c72d..8a04ba5 100644
--- a/lib/lp/app/browser/tests/test_vocabulary.py
+++ b/lib/lp/app/browser/tests/test_vocabulary.py
@@ -4,10 +4,10 @@
4"""Test vocabulary adapters."""4"""Test vocabulary adapters."""
55
6from datetime import datetime6from datetime import datetime
7from urllib.parse import urlencode
78
8import pytz9import pytz
9import simplejson10import simplejson
10from six.moves.urllib.parse import urlencode
11from zope.component import (11from zope.component import (
12 getSiteManager,12 getSiteManager,
13 getUtility,13 getUtility,
diff --git a/lib/lp/app/tests/test_services.py b/lib/lp/app/tests/test_services.py
index 0cbaee4..20f1670 100644
--- a/lib/lp/app/tests/test_services.py
+++ b/lib/lp/app/tests/test_services.py
@@ -4,10 +4,10 @@
4"""Tests for core services infrastructure."""4"""Tests for core services infrastructure."""
55
6import json6import json
7from urllib.parse import urlparse
78
8from fixtures import FakeLogger9from fixtures import FakeLogger
9from lazr.restful.interfaces._rest import IHTTPResource10from lazr.restful.interfaces._rest import IHTTPResource
10from six.moves.urllib.parse import urlparse
11from zope.component import getUtility11from zope.component import getUtility
12from zope.interface import implementer12from zope.interface import implementer
13from zope.interface.interfaces import ComponentLookupError13from zope.interface.interfaces import ComponentLookupError
diff --git a/lib/lp/app/validators/url.py b/lib/lp/app/validators/url.py
index dd29b7a..c90b4c9 100644
--- a/lib/lp/app/validators/url.py
+++ b/lib/lp/app/validators/url.py
@@ -10,8 +10,7 @@ __all__ = [
10 ]10 ]
1111
12from textwrap import dedent12from textwrap import dedent
1313from urllib.parse import urlsplit
14from six.moves.urllib.parse import urlsplit
1514
16from lp import _15from lp import _
17from lp.app.validators import LaunchpadValidationError16from lp.app.validators import LaunchpadValidationError
diff --git a/lib/lp/bugs/browser/buglisting.py b/lib/lp/bugs/browser/buglisting.py
index cbc365b..4fbb813 100644
--- a/lib/lp/bugs/browser/buglisting.py
+++ b/lib/lp/bugs/browser/buglisting.py
@@ -20,6 +20,12 @@ __all__ = [
20 ]20 ]
2121
22import os.path22import os.path
23from urllib.parse import (
24 parse_qs,
25 parse_qsl,
26 quote,
27 urlencode,
28 )
2329
24from lazr.delegates import delegate_to30from lazr.delegates import delegate_to
25from lazr.restful.interfaces import IJSONRequestCache31from lazr.restful.interfaces import IJSONRequestCache
@@ -27,12 +33,6 @@ from lazr.uri import URI
27import pystache33import pystache
28from simplejson import dumps34from simplejson import dumps
29from simplejson.encoder import JSONEncoderForHTML35from simplejson.encoder import JSONEncoderForHTML
30from six.moves.urllib.parse import (
31 parse_qs,
32 parse_qsl,
33 quote,
34 urlencode,
35 )
36from zope.authentication.interfaces import IUnauthenticatedPrincipal36from zope.authentication.interfaces import IUnauthenticatedPrincipal
37from zope.browserpage import ViewPageTemplateFile37from zope.browserpage import ViewPageTemplateFile
38from zope.component import (38from zope.component import (
diff --git a/lib/lp/bugs/browser/bugtarget.py b/lib/lp/bugs/browser/bugtarget.py
index cdceaea..1802a0e 100644
--- a/lib/lp/bugs/browser/bugtarget.py
+++ b/lib/lp/bugs/browser/bugtarget.py
@@ -21,15 +21,15 @@ from datetime import datetime
21from functools import partial21from functools import partial
22import http.client22import http.client
23from io import BytesIO23from io import BytesIO
24from urllib.parse import (
25 quote,
26 urlencode,
27 )
2428
25from lazr.restful.interface import copy_field29from lazr.restful.interface import copy_field
26from lazr.restful.interfaces import IJSONRequestCache30from lazr.restful.interfaces import IJSONRequestCache
27from pytz import timezone31from pytz import timezone
28from simplejson import dumps32from simplejson import dumps
29from six.moves.urllib.parse import (
30 quote,
31 urlencode,
32 )
33from zope.browserpage import ViewPageTemplateFile33from zope.browserpage import ViewPageTemplateFile
34from zope.component import getUtility34from zope.component import getUtility
35from zope.formlib.form import Fields35from zope.formlib.form import Fields
diff --git a/lib/lp/bugs/browser/bugtask.py b/lib/lp/bugs/browser/bugtask.py
index 6e85112..7af4f94 100644
--- a/lib/lp/bugs/browser/bugtask.py
+++ b/lib/lp/bugs/browser/bugtask.py
@@ -33,6 +33,7 @@ from datetime import (
33from itertools import groupby33from itertools import groupby
34from operator import attrgetter34from operator import attrgetter
35import re35import re
36from urllib.parse import quote
3637
37from lazr.delegates import delegate_to38from lazr.delegates import delegate_to
38from lazr.lifecycle.event import ObjectModifiedEvent39from lazr.lifecycle.event import ObjectModifiedEvent
@@ -47,7 +48,6 @@ from lazr.restful.interfaces import (
47from lazr.restful.utils import smartquote48from lazr.restful.utils import smartquote
48from pytz import utc49from pytz import utc
49from simplejson import dumps50from simplejson import dumps
50from six.moves.urllib.parse import quote
51import transaction51import transaction
52from zope import formlib52from zope import formlib
53from zope.browserpage import ViewPageTemplateFile53from zope.browserpage import ViewPageTemplateFile
diff --git a/lib/lp/bugs/browser/person.py b/lib/lp/bugs/browser/person.py
index 4b5de77..d9bc4b6 100644
--- a/lib/lp/bugs/browser/person.py
+++ b/lib/lp/bugs/browser/person.py
@@ -16,8 +16,8 @@ __all__ = [
1616
17import copy17import copy
18from operator import itemgetter18from operator import itemgetter
19from urllib.parse import urlencode
1920
20from six.moves.urllib.parse import urlencode
21from zope.component import getUtility21from zope.component import getUtility
2222
23from lp.bugs.browser.buglisting import BugTaskSearchListingView23from lp.bugs.browser.buglisting import BugTaskSearchListingView
diff --git a/lib/lp/bugs/browser/tests/test_bugattachment_file_access.py b/lib/lp/bugs/browser/tests/test_bugattachment_file_access.py
index 3b48f29..52c2e36 100644
--- a/lib/lp/bugs/browser/tests/test_bugattachment_file_access.py
+++ b/lib/lp/bugs/browser/tests/test_bugattachment_file_access.py
@@ -2,13 +2,13 @@
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4import re4import re
55from urllib.parse import (
6import requests
7from six.moves.urllib.parse import (
8 parse_qs,6 parse_qs,
9 urlparse,7 urlparse,
10 urlunparse,8 urlunparse,
11 )9 )
10
11import requests
12import transaction12import transaction
13from zope.component import (13from zope.component import (
14 getMultiAdapter,14 getMultiAdapter,
diff --git a/lib/lp/bugs/browser/tests/test_bugsubscriptionfilter.py b/lib/lp/bugs/browser/tests/test_bugsubscriptionfilter.py
index 23f9c99..45ec289 100644
--- a/lib/lp/bugs/browser/tests/test_bugsubscriptionfilter.py
+++ b/lib/lp/bugs/browser/tests/test_bugsubscriptionfilter.py
@@ -4,9 +4,9 @@
4"""Tests for bug subscription filter browser code."""4"""Tests for bug subscription filter browser code."""
55
6import json6import json
7from urllib.parse import urlparse
78
8from lxml import html9from lxml import html
9from six.moves.urllib.parse import urlparse
10from testtools.matchers import StartsWith10from testtools.matchers import StartsWith
1111
12from lp.app.enums import InformationType12from lp.app.enums import InformationType
diff --git a/lib/lp/bugs/browser/tests/test_bugtask.py b/lib/lp/bugs/browser/tests/test_bugtask.py
index 9c13e86..4394120 100644
--- a/lib/lp/bugs/browser/tests/test_bugtask.py
+++ b/lib/lp/bugs/browser/tests/test_bugtask.py
@@ -6,12 +6,12 @@ from datetime import (
6 timedelta,6 timedelta,
7 )7 )
8import re8import re
9from urllib.parse import urlencode
910
10from lazr.restful.interfaces import IJSONRequestCache11from lazr.restful.interfaces import IJSONRequestCache
11from pytz import UTC12from pytz import UTC
12import simplejson13import simplejson
13import six14import six
14from six.moves.urllib.parse import urlencode
15import soupmatchers15import soupmatchers
16from testscenarios import (16from testscenarios import (
17 load_tests_apply_scenarios,17 load_tests_apply_scenarios,
diff --git a/lib/lp/bugs/browser/tests/test_structuralsubscription.py b/lib/lp/bugs/browser/tests/test_structuralsubscription.py
index a6fd6a9..5aacbdb 100644
--- a/lib/lp/bugs/browser/tests/test_structuralsubscription.py
+++ b/lib/lp/bugs/browser/tests/test_structuralsubscription.py
@@ -3,7 +3,8 @@
33
4"""Tests for structural subscription traversal."""4"""Tests for structural subscription traversal."""
55
6from six.moves.urllib.parse import urlparse6from urllib.parse import urlparse
7
7from zope.publisher.interfaces import NotFound8from zope.publisher.interfaces import NotFound
89
9from lp.registry.browser.distribution import DistributionNavigation10from lp.registry.browser.distribution import DistributionNavigation
diff --git a/lib/lp/bugs/doc/externalbugtracker-trac-lp-plugin.txt b/lib/lp/bugs/doc/externalbugtracker-trac-lp-plugin.txt
index 8c76531..6e5865f 100644
--- a/lib/lp/bugs/doc/externalbugtracker-trac-lp-plugin.txt
+++ b/lib/lp/bugs/doc/externalbugtracker-trac-lp-plugin.txt
@@ -31,7 +31,7 @@ Trac to validate $token and return a Set-Cookie header.
3131
32 >>> import random32 >>> import random
33 >>> import re33 >>> import re
34 >>> from six.moves.urllib_parse import (34 >>> from urllib.parse import (
35 ... urljoin,35 ... urljoin,
36 ... urlsplit,36 ... urlsplit,
37 ... )37 ... )
diff --git a/lib/lp/bugs/doc/sourceforge-remote-products.txt b/lib/lp/bugs/doc/sourceforge-remote-products.txt
index 8f15721..edd70ce 100644
--- a/lib/lp/bugs/doc/sourceforge-remote-products.txt
+++ b/lib/lp/bugs/doc/sourceforge-remote-products.txt
@@ -41,8 +41,8 @@ Define some request mocks so that we don't try to access SourceForge.
4141
42 >>> import os.path42 >>> import os.path
43 >>> import re43 >>> import re
44 >>> from urllib.parse import urlsplit
44 >>> import responses45 >>> import responses
45 >>> from six.moves.urllib_parse import urlsplit
4646
47 >>> def project_callback(request):47 >>> def project_callback(request):
48 ... url = urlsplit(request.url)48 ... url = urlsplit(request.url)
diff --git a/lib/lp/bugs/externalbugtracker/base.py b/lib/lp/bugs/externalbugtracker/base.py
index 6ebd4bc..8cf7f0e 100644
--- a/lib/lp/bugs/externalbugtracker/base.py
+++ b/lib/lp/bugs/externalbugtracker/base.py
@@ -26,11 +26,12 @@ __all__ = [
26 ]26 ]
2727
2828
29import requests29from urllib.parse import (
30from six.moves.urllib_parse import (
31 urljoin,30 urljoin,
32 urlparse,31 urlparse,
33 )32 )
33
34import requests
34from zope.interface import implementer35from zope.interface import implementer
3536
36from lp.bugs.adapters import treelookup37from lp.bugs.adapters import treelookup
diff --git a/lib/lp/bugs/externalbugtracker/github.py b/lib/lp/bugs/externalbugtracker/github.py
index 4e686ee..8f45e4d 100644
--- a/lib/lp/bugs/externalbugtracker/github.py
+++ b/lib/lp/bugs/externalbugtracker/github.py
@@ -13,13 +13,13 @@ __all__ = [
13from contextlib import contextmanager13from contextlib import contextmanager
14import http.client14import http.client
15import time15import time
1616from urllib.parse import (
17import pytz
18import requests
19from six.moves.urllib.parse import (
20 urlencode,17 urlencode,
21 urlunsplit,18 urlunsplit,
22 )19 )
20
21import pytz
22import requests
23from zope.component import getUtility23from zope.component import getUtility
24from zope.interface import Interface24from zope.interface import Interface
2525
diff --git a/lib/lp/bugs/externalbugtracker/gitlab.py b/lib/lp/bugs/externalbugtracker/gitlab.py
index cc7ac40..444fcb1 100644
--- a/lib/lp/bugs/externalbugtracker/gitlab.py
+++ b/lib/lp/bugs/externalbugtracker/gitlab.py
@@ -9,14 +9,14 @@ __all__ = [
9 ]9 ]
1010
11import http.client11import http.client
1212from urllib.parse import (
13import pytz
14from six.moves.urllib.parse import (
15 quote,13 quote,
16 quote_plus,14 quote_plus,
17 urlunsplit,15 urlunsplit,
18 )16 )
1917
18import pytz
19
20from lp.bugs.externalbugtracker import (20from lp.bugs.externalbugtracker import (
21 BugTrackerConnectError,21 BugTrackerConnectError,
22 ExternalBugTracker,22 ExternalBugTracker,
diff --git a/lib/lp/bugs/externalbugtracker/mantis.py b/lib/lp/bugs/externalbugtracker/mantis.py
index 40562da..bf10470 100644
--- a/lib/lp/bugs/externalbugtracker/mantis.py
+++ b/lib/lp/bugs/externalbugtracker/mantis.py
@@ -11,15 +11,15 @@ __all__ = [
11import csv11import csv
12import logging12import logging
13import re13import re
1414from urllib.parse import (
15from bs4.element import Comment
16from requests.cookies import RequestsCookieJar
17from six.moves.urllib_parse import (
18 parse_qsl,15 parse_qsl,
19 urlencode,16 urlencode,
20 urlunparse,17 urlunparse,
21 )18 )
2219
20from bs4.element import Comment
21from requests.cookies import RequestsCookieJar
22
23from lp.bugs.externalbugtracker import (23from lp.bugs.externalbugtracker import (
24 BugNotFound,24 BugNotFound,
25 BugTrackerConnectError,25 BugTrackerConnectError,
diff --git a/lib/lp/bugs/externalbugtracker/roundup.py b/lib/lp/bugs/externalbugtracker/roundup.py
index 2bd3de2..84e7967 100644
--- a/lib/lp/bugs/externalbugtracker/roundup.py
+++ b/lib/lp/bugs/externalbugtracker/roundup.py
@@ -6,9 +6,9 @@
6__all__ = ['Roundup']6__all__ = ['Roundup']
77
8import csv8import csv
9from urllib.parse import quote_plus
910
10from lazr.uri import URI11from lazr.uri import URI
11from six.moves.urllib.parse import quote_plus
1212
13from lp.bugs.externalbugtracker import (13from lp.bugs.externalbugtracker import (
14 BugNotFound,14 BugNotFound,
diff --git a/lib/lp/bugs/externalbugtracker/tests/test_github.py b/lib/lp/bugs/externalbugtracker/tests/test_github.py
index 87cdafa..b7644b5 100644
--- a/lib/lp/bugs/externalbugtracker/tests/test_github.py
+++ b/lib/lp/bugs/externalbugtracker/tests/test_github.py
@@ -5,14 +5,14 @@
55
6from datetime import datetime6from datetime import datetime
7import json7import json
88from urllib.parse import (
9import pytz
10import responses
11from six.moves.urllib_parse import (
12 parse_qs,9 parse_qs,
13 urlsplit,10 urlsplit,
14 urlunsplit,11 urlunsplit,
15 )12 )
13
14import pytz
15import responses
16from testtools import ExpectedException16from testtools import ExpectedException
17from testtools.matchers import (17from testtools.matchers import (
18 Contains,18 Contains,
diff --git a/lib/lp/bugs/externalbugtracker/tests/test_gitlab.py b/lib/lp/bugs/externalbugtracker/tests/test_gitlab.py
index 9fd7351..2ed17bf 100644
--- a/lib/lp/bugs/externalbugtracker/tests/test_gitlab.py
+++ b/lib/lp/bugs/externalbugtracker/tests/test_gitlab.py
@@ -5,14 +5,14 @@
55
6from datetime import datetime6from datetime import datetime
7import json7import json
88from urllib.parse import (
9import pytz
10import responses
11from six.moves.urllib_parse import (
12 parse_qs,9 parse_qs,
13 urlsplit,10 urlsplit,
14 urlunsplit,11 urlunsplit,
15 )12 )
13
14import pytz
15import responses
16from testtools.matchers import (16from testtools.matchers import (
17 Contains,17 Contains,
18 ContainsDict,18 ContainsDict,
diff --git a/lib/lp/bugs/externalbugtracker/tests/test_mantis.py b/lib/lp/bugs/externalbugtracker/tests/test_mantis.py
index 99de31b..3fc3010 100644
--- a/lib/lp/bugs/externalbugtracker/tests/test_mantis.py
+++ b/lib/lp/bugs/externalbugtracker/tests/test_mantis.py
@@ -3,8 +3,9 @@
33
4"""Tests for the Mantis BugTracker."""4"""Tests for the Mantis BugTracker."""
55
6from urllib.parse import urljoin
7
6import responses8import responses
7from six.moves.urllib_parse import urljoin
8from testtools.matchers import (9from testtools.matchers import (
9 Equals,10 Equals,
10 Is,11 Is,
diff --git a/lib/lp/bugs/externalbugtracker/xmlrpc.py b/lib/lp/bugs/externalbugtracker/xmlrpc.py
index 6d63fe9..228a9de 100644
--- a/lib/lp/bugs/externalbugtracker/xmlrpc.py
+++ b/lib/lp/bugs/externalbugtracker/xmlrpc.py
@@ -9,6 +9,10 @@ __all__ = [
99
1010
11from io import BytesIO11from io import BytesIO
12from urllib.parse import (
13 urlparse,
14 urlunparse,
15 )
12from xmlrpc.client import (16from xmlrpc.client import (
13 ProtocolError,17 ProtocolError,
14 Transport,18 Transport,
@@ -18,10 +22,6 @@ from defusedxml.xmlrpc import monkey_patch
18import requests22import requests
19from requests.cookies import RequestsCookieJar23from requests.cookies import RequestsCookieJar
20import six24import six
21from six.moves.urllib.parse import (
22 urlparse,
23 urlunparse,
24 )
2525
26from lp.bugs.externalbugtracker.base import repost_on_redirect_hook26from lp.bugs.externalbugtracker.base import repost_on_redirect_hook
27from lp.services.config import config27from lp.services.config import config
diff --git a/lib/lp/bugs/model/bugtracker.py b/lib/lp/bugs/model/bugtracker.py
index a8070ae..9106ffe 100644
--- a/lib/lp/bugs/model/bugtracker.py
+++ b/lib/lp/bugs/model/bugtracker.py
@@ -12,15 +12,15 @@ __all__ = [
1212
13from datetime import datetime13from datetime import datetime
14from itertools import chain14from itertools import chain
1515from urllib.parse import (
16from lazr.uri import URI
17from pytz import timezone
18import six
19from six.moves.urllib.parse import (
20 quote,16 quote,
21 urlsplit,17 urlsplit,
22 urlunsplit,18 urlunsplit,
23 )19 )
20
21from lazr.uri import URI
22from pytz import timezone
23import six
24from storm.expr import (24from storm.expr import (
25 Count,25 Count,
26 Desc,26 Desc,
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
index 1d29a68..d3656ca 100644
--- 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
@@ -74,7 +74,7 @@ will be displayed.
74The description given in the link to the bug filing form contains a74The description given in the link to the bug filing form contains a
75link back to bug 13, the place where it was originally filed.75link back to bug 13, the place where it was originally filed.
7676
77 >>> from six.moves.urllib.parse import (77 >>> from urllib.parse import (
78 ... parse_qs,78 ... parse_qs,
79 ... urlparse,79 ... urlparse,
80 ... )80 ... )
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
index bf2bed7..2211cbc 100644
--- 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
@@ -144,7 +144,7 @@ status. Bookmarks of such searches work nevertheless.
144144
145The user opens a bookmark for "upstream status doesn't matter"145The user opens a bookmark for "upstream status doesn't matter"
146146
147 >>> from six.moves.urllib.parse import urlencode147 >>> from urllib.parse import urlencode
148 >>> bookmark_params = {148 >>> bookmark_params = {
149 ... 'field.status_upstream': '',149 ... 'field.status_upstream': '',
150 ... 'field.status_upstream-empty-marker': '1',150 ... 'field.status_upstream-empty-marker': '1',
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
index 2992c0b..9bf67e9 100644
--- 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
@@ -22,7 +22,7 @@ The user is redirected to a new url to make the change explicit, and
22to allow user agents (and users) to update bookmarks, etc.22to allow user agents (and users) to update bookmarks, etc.
2323
24 >>> def print_query_changes(query_string_before, query_string_after):24 >>> def print_query_changes(query_string_before, query_string_after):
25 ... from six.moves.urllib.parse import parse_qsl25 ... from urllib.parse import parse_qsl
26 ... query_before = parse_qsl(26 ... query_before = parse_qsl(
27 ... query_string_before, keep_blank_values=True)27 ... query_string_before, keep_blank_values=True)
28 ... query_after = parse_qsl(28 ... query_after = parse_qsl(
diff --git a/lib/lp/bugs/stories/webservice/xx-bug.txt b/lib/lp/bugs/stories/webservice/xx-bug.txt
index e19ef0f..718e63c 100644
--- a/lib/lp/bugs/stories/webservice/xx-bug.txt
+++ b/lib/lp/bugs/stories/webservice/xx-bug.txt
@@ -1335,7 +1335,7 @@ we must follow to download the data.
1335 Location: http://.../numbers.txt1335 Location: http://.../numbers.txt
1336 ...1336 ...
13371337
1338 >>> from six.moves.urllib.request import urlopen1338 >>> from urllib.request import urlopen
13391339
1340 >>> data = None1340 >>> data = None
1341 >>> conn = urlopen(data_response.getHeader('Location'))1341 >>> conn = urlopen(data_response.getHeader('Location'))
diff --git a/lib/lp/bugs/tests/externalbugtracker.py b/lib/lp/bugs/tests/externalbugtracker.py
index a7706d7..11dcaab 100644
--- a/lib/lp/bugs/tests/externalbugtracker.py
+++ b/lib/lp/bugs/tests/externalbugtracker.py
@@ -14,14 +14,14 @@ import os
14import random14import random
15import re15import re
16import time16import time
17import xmlrpc.client17from urllib.parse import (
18
19import responses
20from six.moves.urllib_parse import (
21 parse_qs,18 parse_qs,
22 urljoin,19 urljoin,
23 urlsplit,20 urlsplit,
24 )21 )
22import xmlrpc.client
23
24import responses
25from zope.component import getUtility25from zope.component import getUtility
26from zope.security.proxy import removeSecurityProxy26from zope.security.proxy import removeSecurityProxy
2727
diff --git a/lib/lp/bugs/tests/test_bugtracker.py b/lib/lp/bugs/tests/test_bugtracker.py
index 59f4e7d..d4a3e28 100644
--- a/lib/lp/bugs/tests/test_bugtracker.py
+++ b/lib/lp/bugs/tests/test_bugtracker.py
@@ -11,11 +11,11 @@ from doctest import (
11 NORMALIZE_WHITESPACE,11 NORMALIZE_WHITESPACE,
12 )12 )
13import unittest13import unittest
14from urllib.parse import urlencode
1415
15from lazr.lifecycle.snapshot import Snapshot16from lazr.lifecycle.snapshot import Snapshot
16from pytz import utc17from pytz import utc
17import responses18import responses
18from six.moves.urllib_parse import urlencode
19from testtools.matchers import (19from testtools.matchers import (
20 Equals,20 Equals,
21 MatchesListwise,21 MatchesListwise,
diff --git a/lib/lp/bugs/tests/test_bugwatch.py b/lib/lp/bugs/tests/test_bugwatch.py
index 402253b..9a363d5 100644
--- a/lib/lp/bugs/tests/test_bugwatch.py
+++ b/lib/lp/bugs/tests/test_bugwatch.py
@@ -8,10 +8,10 @@ from datetime import (
8 timedelta,8 timedelta,
9 )9 )
10import re10import re
11from urllib.parse import urlunsplit
1112
12from lazr.lifecycle.snapshot import Snapshot13from lazr.lifecycle.snapshot import Snapshot
13from pytz import utc14from pytz import utc
14from six.moves.urllib.parse import urlunsplit
15from storm.store import Store15from storm.store import Store
16from testscenarios import (16from testscenarios import (
17 load_tests_apply_scenarios,17 load_tests_apply_scenarios,
diff --git a/lib/lp/buildmaster/interactor.py b/lib/lp/buildmaster/interactor.py
index 679d5c6..eed2b23 100644
--- a/lib/lp/buildmaster/interactor.py
+++ b/lib/lp/buildmaster/interactor.py
@@ -14,10 +14,10 @@ import logging
14import os.path14import os.path
15import sys15import sys
16import traceback16import traceback
17from urllib.parse import urlparse
1718
18from ampoule.pool import ProcessPool19from ampoule.pool import ProcessPool
19import six20import six
20from six.moves.urllib.parse import urlparse
21import transaction21import transaction
22from twisted.internet import (22from twisted.internet import (
23 defer,23 defer,
diff --git a/lib/lp/buildmaster/tests/builderproxy.py b/lib/lp/buildmaster/tests/builderproxy.py
index 82197ed..356bc0f 100644
--- a/lib/lp/buildmaster/tests/builderproxy.py
+++ b/lib/lp/buildmaster/tests/builderproxy.py
@@ -6,10 +6,10 @@
6from datetime import datetime6from datetime import datetime
7import json7import json
8from textwrap import dedent8from textwrap import dedent
9from urllib.parse import urlsplit
9import uuid10import uuid
1011
11import fixtures12import fixtures
12from six.moves.urllib_parse import urlsplit
13from testtools.matchers import (13from testtools.matchers import (
14 Equals,14 Equals,
15 HasLength,15 HasLength,
diff --git a/lib/lp/charms/tests/test_charmrecipebuildbehaviour.py b/lib/lp/charms/tests/test_charmrecipebuildbehaviour.py
index 6cd8791..a473487 100644
--- a/lib/lp/charms/tests/test_charmrecipebuildbehaviour.py
+++ b/lib/lp/charms/tests/test_charmrecipebuildbehaviour.py
@@ -7,11 +7,11 @@ import base64
7from datetime import datetime7from datetime import datetime
8import os.path8import os.path
9import time9import time
10from urllib.parse import urlsplit
10import uuid11import uuid
1112
12from fixtures import MockPatch13from fixtures import MockPatch
13from pymacaroons import Macaroon14from pymacaroons import Macaroon
14from six.moves.urllib_parse import urlsplit
15from testtools import ExpectedException15from testtools import ExpectedException
16from testtools.matchers import (16from testtools.matchers import (
17 ContainsDict,17 ContainsDict,
diff --git a/lib/lp/code/browser/branchlisting.py b/lib/lp/code/browser/branchlisting.py
index 56e26b2..eee45b8 100644
--- a/lib/lp/code/browser/branchlisting.py
+++ b/lib/lp/code/browser/branchlisting.py
@@ -25,13 +25,13 @@ __all__ = [
25 ]25 ]
2626
27from operator import attrgetter27from operator import attrgetter
28from urllib.parse import parse_qs
2829
29from lazr.delegates import delegate_to30from lazr.delegates import delegate_to
30from lazr.enum import (31from lazr.enum import (
31 EnumeratedType,32 EnumeratedType,
32 Item,33 Item,
33 )34 )
34from six.moves.urllib.parse import parse_qs
35from storm.expr import Desc35from storm.expr import Desc
36from zope.browserpage import ViewPageTemplateFile36from zope.browserpage import ViewPageTemplateFile
37from zope.component import getUtility37from zope.component import getUtility
diff --git a/lib/lp/code/browser/branchmergeproposal.py b/lib/lp/code/browser/branchmergeproposal.py
index 4e89019..fcaddeb 100644
--- a/lib/lp/code/browser/branchmergeproposal.py
+++ b/lib/lp/code/browser/branchmergeproposal.py
@@ -26,6 +26,10 @@ __all__ = [
2626
27from functools import wraps27from functools import wraps
28import operator28import operator
29from urllib.parse import (
30 urlsplit,
31 urlunsplit,
32 )
2933
30from lazr.delegates import delegate_to34from lazr.delegates import delegate_to
31from lazr.restful.interface import copy_field35from lazr.restful.interface import copy_field
@@ -34,10 +38,6 @@ from lazr.restful.interfaces import (
34 IWebServiceClientRequest,38 IWebServiceClientRequest,
35 )39 )
36import simplejson40import simplejson
37from six.moves.urllib_parse import (
38 urlsplit,
39 urlunsplit,
40 )
41from zope.component import (41from zope.component import (
42 adapter,42 adapter,
43 getMultiAdapter,43 getMultiAdapter,
diff --git a/lib/lp/code/browser/codeimport.py b/lib/lp/code/browser/codeimport.py
index 5ecf7d4..33a2cd4 100644
--- a/lib/lp/code/browser/codeimport.py
+++ b/lib/lp/code/browser/codeimport.py
@@ -18,12 +18,12 @@ __all__ = [
18 ]18 ]
1919
20from textwrap import dedent20from textwrap import dedent
21from urllib.parse import urlparse
2122
22from lazr.restful.interface import (23from lazr.restful.interface import (
23 copy_field,24 copy_field,
24 use_template,25 use_template,
25 )26 )
26from six.moves.urllib.parse import urlparse
27from zope.component import (27from zope.component import (
28 getUtility,28 getUtility,
29 queryAdapter,29 queryAdapter,
diff --git a/lib/lp/code/browser/gitref.py b/lib/lp/code/browser/gitref.py
index fedff3e..bc72f3a 100644
--- a/lib/lp/code/browser/gitref.py
+++ b/lib/lp/code/browser/gitref.py
@@ -10,14 +10,14 @@ __all__ = [
10 ]10 ]
1111
12import json12import json
1313from urllib.parse import (
14from breezy import urlutils
15from lazr.restful.interface import copy_field
16from six.moves.urllib_parse import (
17 quote_plus,14 quote_plus,
18 urlsplit,15 urlsplit,
19 urlunsplit,16 urlunsplit,
20 )17 )
18
19from breezy import urlutils
20from lazr.restful.interface import copy_field
21from zope.component import getUtility21from zope.component import getUtility
22from zope.formlib.widget import CustomWidgetFactory22from zope.formlib.widget import CustomWidgetFactory
23from zope.formlib.widgets import TextAreaWidget23from zope.formlib.widgets import TextAreaWidget
diff --git a/lib/lp/code/browser/gitrepository.py b/lib/lp/code/browser/gitrepository.py
index 072f626..96a6ce0 100644
--- a/lib/lp/code/browser/gitrepository.py
+++ b/lib/lp/code/browser/gitrepository.py
@@ -23,6 +23,10 @@ __all__ = [
23import base6423import base64
24import binascii24import binascii
25from collections import defaultdict25from collections import defaultdict
26from urllib.parse import (
27 urlsplit,
28 urlunsplit,
29 )
2630
27from breezy import urlutils31from breezy import urlutils
28from lazr.lifecycle.event import ObjectModifiedEvent32from lazr.lifecycle.event import ObjectModifiedEvent
@@ -31,10 +35,6 @@ from lazr.restful.interface import (
31 copy_field,35 copy_field,
32 use_template,36 use_template,
33 )37 )
34from six.moves.urllib_parse import (
35 urlsplit,
36 urlunsplit,
37 )
38from zope.component import getUtility38from zope.component import getUtility
39from zope.event import notify39from zope.event import notify
40from zope.formlib import form40from zope.formlib import form
diff --git a/lib/lp/code/browser/tests/test_gitsubscription.py b/lib/lp/code/browser/tests/test_gitsubscription.py
index 1fb5fb7..6f2a5a6 100644
--- a/lib/lp/code/browser/tests/test_gitsubscription.py
+++ b/lib/lp/code/browser/tests/test_gitsubscription.py
@@ -3,8 +3,9 @@
33
4"""Unit tests for GitSubscriptions."""4"""Unit tests for GitSubscriptions."""
55
6from urllib.parse import urlencode
7
6from fixtures import FakeLogger8from fixtures import FakeLogger
7from six.moves.urllib.parse import urlencode
8from testtools.matchers import MatchesStructure9from testtools.matchers import MatchesStructure
9from zope.security.interfaces import Unauthorized10from zope.security.interfaces import Unauthorized
10from zope.testbrowser.browser import LinkNotFoundError11from zope.testbrowser.browser import LinkNotFoundError
diff --git a/lib/lp/code/interfaces/codehosting.py b/lib/lp/code/interfaces/codehosting.py
index 91bce70..07a9411 100644
--- a/lib/lp/code/interfaces/codehosting.py
+++ b/lib/lp/code/interfaces/codehosting.py
@@ -21,10 +21,10 @@ __all__ = [
21 ]21 ]
2222
23import os.path23import os.path
24from urllib.parse import quote
2425
25from lazr.uri import URI26from lazr.uri import URI
26import six27import six
27from six.moves.urllib.parse import quote
28from zope.interface import Interface28from zope.interface import Interface
2929
30from lp.app.validators.name import valid_name30from lp.app.validators.name import valid_name
diff --git a/lib/lp/code/model/branch.py b/lib/lp/code/model/branch.py
index fc7da1a..2b940ba 100644
--- a/lib/lp/code/model/branch.py
+++ b/lib/lp/code/model/branch.py
@@ -11,6 +11,7 @@ from datetime import datetime
11from functools import partial11from functools import partial
12import operator12import operator
13import os.path13import os.path
14from urllib.parse import urlsplit
1415
15from breezy import urlutils16from breezy import urlutils
16from breezy.revision import NULL_REVISION17from breezy.revision import NULL_REVISION
@@ -18,7 +19,6 @@ from breezy.url_policy_open import open_only_scheme
18from lazr.lifecycle.event import ObjectCreatedEvent19from lazr.lifecycle.event import ObjectCreatedEvent
19import pytz20import pytz
20import six21import six
21from six.moves.urllib_parse import urlsplit
22from storm.expr import (22from storm.expr import (
23 And,23 And,
24 Coalesce,24 Coalesce,
diff --git a/lib/lp/code/model/branchhosting.py b/lib/lp/code/model/branchhosting.py
index 3911c16..c585df2 100644
--- a/lib/lp/code/model/branchhosting.py
+++ b/lib/lp/code/model/branchhosting.py
@@ -9,13 +9,13 @@ __all__ = [
99
10import json10import json
11import sys11import sys
1212from urllib.parse import (
13from lazr.restful.utils import get_current_browser_request
14import requests
15from six.moves.urllib_parse import (
16 quote,13 quote,
17 urljoin,14 urljoin,
18 )15 )
16
17from lazr.restful.utils import get_current_browser_request
18import requests
19from zope.interface import implementer19from zope.interface import implementer
2020
21from lp.code.errors import (21from lp.code.errors import (
diff --git a/lib/lp/code/model/githosting.py b/lib/lp/code/model/githosting.py
index c5ade39..675b1eb 100644
--- a/lib/lp/code/model/githosting.py
+++ b/lib/lp/code/model/githosting.py
@@ -11,14 +11,14 @@ __all__ = [
11import base6411import base64
12import json12import json
13import sys13import sys
14from urllib.parse import (
15 quote,
16 urljoin,
17 )
1418
15from lazr.restful.utils import get_current_browser_request19from lazr.restful.utils import get_current_browser_request
16import requests20import requests
17from six import ensure_text21from six import ensure_text
18from six.moves.urllib.parse import (
19 quote,
20 urljoin,
21 )
22from zope.interface import implementer22from zope.interface import implementer
2323
24from lp.code.errors import (24from lp.code.errors import (
diff --git a/lib/lp/code/model/gitref.py b/lib/lp/code/model/gitref.py
index a3ef756..f91d1e5 100644
--- a/lib/lp/code/model/gitref.py
+++ b/lib/lp/code/model/gitref.py
@@ -10,16 +10,16 @@ __all__ = [
1010
11from functools import partial11from functools import partial
12import re12import re
13from urllib.parse import (
14 quote,
15 quote_plus,
16 urlsplit,
17 )
1318
14from lazr.lifecycle.event import ObjectCreatedEvent19from lazr.lifecycle.event import ObjectCreatedEvent
15import pytz20import pytz
16import requests21import requests
17import six22import six
18from six.moves.urllib.parse import (
19 quote,
20 quote_plus,
21 urlsplit,
22 )
23from storm.expr import And23from storm.expr import And
24from storm.locals import (24from storm.locals import (
25 DateTime,25 DateTime,
diff --git a/lib/lp/code/model/gitrepository.py b/lib/lp/code/model/gitrepository.py
index f1a9dfa..39ffda1 100644
--- a/lib/lp/code/model/gitrepository.py
+++ b/lib/lp/code/model/gitrepository.py
@@ -25,6 +25,11 @@ from itertools import (
25 )25 )
26import logging26import logging
27from operator import attrgetter27from operator import attrgetter
28from urllib.parse import (
29 quote_plus,
30 urlsplit,
31 urlunsplit,
32 )
2833
29from breezy import urlutils34from breezy import urlutils
30from lazr.enum import DBItem35from lazr.enum import DBItem
@@ -32,11 +37,6 @@ from lazr.lifecycle.event import ObjectModifiedEvent
32from lazr.lifecycle.snapshot import Snapshot37from lazr.lifecycle.snapshot import Snapshot
33import pytz38import pytz
34import six39import six
35from six.moves.urllib.parse import (
36 quote_plus,
37 urlsplit,
38 urlunsplit,
39 )
40from storm.databases.postgres import Returning40from storm.databases.postgres import Returning
41from storm.expr import (41from storm.expr import (
42 And,42 And,
diff --git a/lib/lp/code/model/tests/test_githosting.py b/lib/lp/code/model/tests/test_githosting.py
index ea1ebbd..ef7802c 100644
--- a/lib/lp/code/model/tests/test_githosting.py
+++ b/lib/lp/code/model/tests/test_githosting.py
@@ -11,13 +11,13 @@ import base64
11from contextlib import contextmanager11from contextlib import contextmanager
12import json12import json
13import re13import re
1414from urllib.parse import (
15from lazr.restful.utils import get_current_browser_request
16import responses
17from six.moves.urllib.parse import (
18 parse_qsl,15 parse_qsl,
19 urlsplit,16 urlsplit,
20 )17 )
18
19from lazr.restful.utils import get_current_browser_request
20import responses
21from testtools.matchers import (21from testtools.matchers import (
22 AfterPreprocessing,22 AfterPreprocessing,
23 Equals,23 Equals,
diff --git a/lib/lp/code/stories/branches/xx-private-branch-listings.txt b/lib/lp/code/stories/branches/xx-private-branch-listings.txt
index c775877..3e7fa21 100644
--- a/lib/lp/code/stories/branches/xx-private-branch-listings.txt
+++ b/lib/lp/code/stories/branches/xx-private-branch-listings.txt
@@ -145,7 +145,7 @@ Person code listing pages
145The person code listings is the other obvious place to filter out the145The person code listings is the other obvious place to filter out the
146viewable branches.146viewable branches.
147147
148 >>> from six.moves.urllib.parse import urlencode148 >>> from urllib.parse import urlencode
149 >>> def print_person_code_listing(browser, category=None):149 >>> def print_person_code_listing(browser, category=None):
150 ... params = {'batch': '15'}150 ... params = {'batch': '15'}
151 ... if category is not None:151 ... if category is not None:
diff --git a/lib/lp/code/stories/branches/xx-subscribing-branches.txt b/lib/lp/code/stories/branches/xx-subscribing-branches.txt
index 1974c42..5db15a2 100644
--- a/lib/lp/code/stories/branches/xx-subscribing-branches.txt
+++ b/lib/lp/code/stories/branches/xx-subscribing-branches.txt
@@ -120,7 +120,7 @@ shown to the user.
120Clicking the back button and then clicking on either Change or120Clicking the back button and then clicking on either Change or
121Unsubscribe will give a message that we are not subscribed.121Unsubscribe will give a message that we are not subscribed.
122122
123 >>> from six.moves.urllib.parse import urlencode123 >>> from urllib.parse import urlencode
124 >>> browser.addHeader('Referer', 'https://launchpad.test/')124 >>> browser.addHeader('Referer', 'https://launchpad.test/')
125 >>> browser.open(125 >>> browser.open(
126 ... form_url,126 ... form_url,
diff --git a/lib/lp/code/xmlrpc/git.py b/lib/lp/code/xmlrpc/git.py
index 23c67a2..6221845 100644
--- a/lib/lp/code/xmlrpc/git.py
+++ b/lib/lp/code/xmlrpc/git.py
@@ -9,12 +9,12 @@ __all__ = [
99
10import logging10import logging
11import sys11import sys
12from urllib.parse import quote
12import uuid13import uuid
13import xmlrpc.client14import xmlrpc.client
1415
15from pymacaroons import Macaroon16from pymacaroons import Macaroon
16import six17import six
17from six.moves.urllib.parse import quote
18import transaction18import transaction
19from zope.component import getUtility19from zope.component import getUtility
20from zope.error.interfaces import IErrorReportingUtility20from zope.error.interfaces import IErrorReportingUtility
diff --git a/lib/lp/code/xmlrpc/tests/test_git.py b/lib/lp/code/xmlrpc/tests/test_git.py
index 1f2b52a..131b803 100644
--- a/lib/lp/code/xmlrpc/tests/test_git.py
+++ b/lib/lp/code/xmlrpc/tests/test_git.py
@@ -5,6 +5,7 @@
55
6from datetime import datetime6from datetime import datetime
7import hashlib7import hashlib
8from urllib.parse import quote
8import uuid9import uuid
9import xmlrpc.client10import xmlrpc.client
1011
@@ -12,7 +13,6 @@ from fixtures import FakeLogger
12from pymacaroons import Macaroon13from pymacaroons import Macaroon
13import pytz14import pytz
14import six15import six
15from six.moves.urllib.parse import quote
16from storm.store import Store16from storm.store import Store
17from testtools.matchers import (17from testtools.matchers import (
18 Equals,18 Equals,
diff --git a/lib/lp/codehosting/puller/tests/test_errors.py b/lib/lp/codehosting/puller/tests/test_errors.py
index f06ca00..4ec9a75 100644
--- a/lib/lp/codehosting/puller/tests/test_errors.py
+++ b/lib/lp/codehosting/puller/tests/test_errors.py
@@ -7,6 +7,7 @@ import http.client
7import os7import os
8import socket8import socket
9import tempfile9import tempfile
10from urllib.error import HTTPError
1011
11from breezy.errors import (12from breezy.errors import (
12 BzrError,13 BzrError,
@@ -20,7 +21,6 @@ from breezy.url_policy_open import (
20 BranchReferenceForbidden,21 BranchReferenceForbidden,
21 )22 )
22from lazr.uri import InvalidURIError23from lazr.uri import InvalidURIError
23from six.moves.urllib.error import HTTPError
2424
25from lp.code.enums import BranchType25from lp.code.enums import BranchType
26from lp.codehosting.puller.worker import (26from lp.codehosting.puller.worker import (
diff --git a/lib/lp/codehosting/puller/worker.py b/lib/lp/codehosting/puller/worker.py
index 5f4e58d..be4cb8c 100644
--- a/lib/lp/codehosting/puller/worker.py
+++ b/lib/lp/codehosting/puller/worker.py
@@ -9,6 +9,8 @@ import sys
9# line below this comment.9# line below this comment.
10import lp.codehosting # noqa: F401 # isort: split10import lp.codehosting # noqa: F401 # isort: split
1111
12from urllib.error import HTTPError
13
12from breezy import (14from breezy import (
13 errors,15 errors,
14 urlutils,16 urlutils,
@@ -39,7 +41,6 @@ from lazr.uri import (
39 URI,41 URI,
40 )42 )
41import six43import six
42from six.moves.urllib.error import HTTPError
4344
44from lp.code.bzr import (45from lp.code.bzr import (
45 BranchFormat,46 BranchFormat,
diff --git a/lib/lp/codehosting/scanner/buglinks.py b/lib/lp/codehosting/scanner/buglinks.py
index 33a18ed..f7fcfd5 100644
--- a/lib/lp/codehosting/scanner/buglinks.py
+++ b/lib/lp/codehosting/scanner/buglinks.py
@@ -7,8 +7,9 @@ __all__ = [
7 'BugBranchLinker',7 'BugBranchLinker',
8 ]8 ]
99
10from urllib.parse import urlsplit
11
10from breezy.bugtracker import InvalidBugStatus12from breezy.bugtracker import InvalidBugStatus
11from six.moves.urllib.parse import urlsplit
12from zope.component import getUtility13from zope.component import getUtility
1314
14from lp.app.errors import NotFoundError15from lp.app.errors import NotFoundError
diff --git a/lib/lp/codehosting/sshserver/session.py b/lib/lp/codehosting/sshserver/session.py
index 9dc9a5d..4f0d549 100644
--- a/lib/lp/codehosting/sshserver/session.py
+++ b/lib/lp/codehosting/sshserver/session.py
@@ -8,11 +8,11 @@ __all__ = [
8 ]8 ]
99
10import os10import os
11from urllib.parse import urlparse
1112
12from lazr.sshserver.events import AvatarEvent13from lazr.sshserver.events import AvatarEvent
13from lazr.sshserver.session import DoNothingSession14from lazr.sshserver.session import DoNothingSession
14import six15import six
15from six.moves.urllib.parse import urlparse
16from twisted.internet import process16from twisted.internet import process
17from twisted.python import log17from twisted.python import log
18from zope.event import notify18from zope.event import notify
diff --git a/lib/lp/codehosting/tests/test_acceptance.py b/lib/lp/codehosting/tests/test_acceptance.py
index 0beee84..835b4d8 100644
--- a/lib/lp/codehosting/tests/test_acceptance.py
+++ b/lib/lp/codehosting/tests/test_acceptance.py
@@ -5,6 +5,7 @@
55
6import os6import os
7import re7import re
8from urllib.request import urlopen
8import xmlrpc.client9import xmlrpc.client
910
10import breezy.branch11import breezy.branch
@@ -13,7 +14,6 @@ from breezy.tests.per_repository import all_repository_format_scenarios
13from breezy.urlutils import local_path_from_url14from breezy.urlutils import local_path_from_url
14from breezy.workingtree import WorkingTree15from breezy.workingtree import WorkingTree
15import six16import six
16from six.moves.urllib.request import urlopen
17from testscenarios import (17from testscenarios import (
18 load_tests_apply_scenarios,18 load_tests_apply_scenarios,
19 WithScenarios,19 WithScenarios,
diff --git a/lib/lp/oci/browser/tests/test_ocirecipe.py b/lib/lp/oci/browser/tests/test_ocirecipe.py
index 9b17ee7..97fc3c9 100644
--- a/lib/lp/oci/browser/tests/test_ocirecipe.py
+++ b/lib/lp/oci/browser/tests/test_ocirecipe.py
@@ -8,10 +8,10 @@ from datetime import (
8 timedelta,8 timedelta,
9 )9 )
10from operator import attrgetter10from operator import attrgetter
11from urllib.parse import quote
1112
12from fixtures import FakeLogger13from fixtures import FakeLogger
13import pytz14import pytz
14from six.moves.urllib.parse import quote
15import soupmatchers15import soupmatchers
16from storm.locals import Store16from storm.locals import Store
17from testtools.matchers import (17from testtools.matchers import (
diff --git a/lib/lp/oci/model/ociregistryclient.py b/lib/lp/oci/model/ociregistryclient.py
index e04a17a..1b71e33 100644
--- a/lib/lp/oci/model/ociregistryclient.py
+++ b/lib/lp/oci/model/ociregistryclient.py
@@ -16,6 +16,7 @@ import json
16import logging16import logging
17import re17import re
18import tarfile18import tarfile
19from urllib.parse import urlparse
1920
20import boto321import boto3
21from botocore.config import Config22from botocore.config import Config
@@ -24,7 +25,6 @@ from requests.exceptions import (
24 HTTPError,25 HTTPError,
25 )26 )
26from requests.utils import parse_dict_header27from requests.utils import parse_dict_header
27from six.moves.urllib.parse import urlparse
28from tenacity import (28from tenacity import (
29 before_log,29 before_log,
30 retry,30 retry,
diff --git a/lib/lp/oci/tests/test_ocirecipebuild.py b/lib/lp/oci/tests/test_ocirecipebuild.py
index 8a9c33b..3a1b83d 100644
--- a/lib/lp/oci/tests/test_ocirecipebuild.py
+++ b/lib/lp/oci/tests/test_ocirecipebuild.py
@@ -7,11 +7,11 @@ from datetime import (
7 datetime,7 datetime,
8 timedelta,8 timedelta,
9 )9 )
10from urllib.request import urlopen
1011
11from fixtures import FakeLogger12from fixtures import FakeLogger
12from pymacaroons import Macaroon13from pymacaroons import Macaroon
13import pytz14import pytz
14from six.moves.urllib.request import urlopen
15from testtools.matchers import (15from testtools.matchers import (
16 ContainsDict,16 ContainsDict,
17 Equals,17 Equals,
diff --git a/lib/lp/oci/tests/test_ocirecipebuildbehaviour.py b/lib/lp/oci/tests/test_ocirecipebuildbehaviour.py
index 890a916..e4b0fa7 100644
--- a/lib/lp/oci/tests/test_ocirecipebuildbehaviour.py
+++ b/lib/lp/oci/tests/test_ocirecipebuildbehaviour.py
@@ -10,6 +10,7 @@ import os
10import shutil10import shutil
11import tempfile11import tempfile
12import time12import time
13from urllib.parse import urlsplit
13import uuid14import uuid
1415
15import fixtures16import fixtures
@@ -17,7 +18,6 @@ from fixtures import MockPatch
17from pymacaroons import Macaroon18from pymacaroons import Macaroon
18import pytz19import pytz
19import six20import six
20from six.moves.urllib_parse import urlsplit
21from testtools import ExpectedException21from testtools import ExpectedException
22from testtools.matchers import (22from testtools.matchers import (
23 AfterPreprocessing,23 AfterPreprocessing,
diff --git a/lib/lp/oci/vocabularies.py b/lib/lp/oci/vocabularies.py
index e8e60df..84b680b 100644
--- a/lib/lp/oci/vocabularies.py
+++ b/lib/lp/oci/vocabularies.py
@@ -5,10 +5,11 @@
55
6__all__ = []6__all__ = []
77
8from six.moves.urllib.parse import (8from urllib.parse import (
9 quote,9 quote,
10 unquote,10 unquote,
11 )11 )
12
12from zope.component import getUtility13from zope.component import getUtility
13from zope.interface import implementer14from zope.interface import implementer
14from zope.schema.vocabulary import SimpleTerm15from zope.schema.vocabulary import SimpleTerm
diff --git a/lib/lp/registry/browser/mailinglists.py b/lib/lp/registry/browser/mailinglists.py
index bbc26a2..be1e872 100644
--- a/lib/lp/registry/browser/mailinglists.py
+++ b/lib/lp/registry/browser/mailinglists.py
@@ -10,8 +10,8 @@ __all__ = [
1010
1111
12from textwrap import TextWrapper12from textwrap import TextWrapper
13from urllib.parse import quote
1314
14from six.moves.urllib.parse import quote
15from zope.component import getUtility15from zope.component import getUtility
1616
17from lp.app.browser.tales import PersonFormatterAPI17from lp.app.browser.tales import PersonFormatterAPI
diff --git a/lib/lp/registry/browser/ociproject.py b/lib/lp/registry/browser/ociproject.py
index 85a1c00..00e8024 100644
--- a/lib/lp/registry/browser/ociproject.py
+++ b/lib/lp/registry/browser/ociproject.py
@@ -12,11 +12,12 @@ __all__ = [
12 'OCIProjectURL',12 'OCIProjectURL',
13 ]13 ]
1414
15from breezy import urlutils15from urllib.parse import (
16from six.moves.urllib.parse import (
17 urlsplit,16 urlsplit,
18 urlunsplit,17 urlunsplit,
19 )18 )
19
20from breezy import urlutils
20from zope.component import getUtility21from zope.component import getUtility
21from zope.interface import implementer22from zope.interface import implementer
2223
diff --git a/lib/lp/registry/browser/person.py b/lib/lp/registry/browser/person.py
index ccd09c7..99526b7 100644
--- a/lib/lp/registry/browser/person.py
+++ b/lib/lp/registry/browser/person.py
@@ -57,6 +57,10 @@ from operator import (
57 itemgetter,57 itemgetter,
58 )58 )
59from textwrap import dedent59from textwrap import dedent
60from urllib.parse import (
61 quote,
62 urlencode,
63 )
6064
61from lazr.config import as_timedelta65from lazr.config import as_timedelta
62from lazr.delegates import delegate_to66from lazr.delegates import delegate_to
@@ -65,10 +69,6 @@ from lazr.restful.interfaces import IWebServiceClientRequest
65from lazr.restful.utils import smartquote69from lazr.restful.utils import smartquote
66from lazr.uri import URI70from lazr.uri import URI
67import pytz71import pytz
68from six.moves.urllib.parse import (
69 quote,
70 urlencode,
71 )
72from storm.zope.interfaces import IResultSet72from storm.zope.interfaces import IResultSet
73from zope.browserpage import ViewPageTemplateFile73from zope.browserpage import ViewPageTemplateFile
74from zope.component import (74from zope.component import (
diff --git a/lib/lp/registry/browser/product.py b/lib/lp/registry/browser/product.py
index faea1f8..9001fdb 100644
--- a/lib/lp/registry/browser/product.py
+++ b/lib/lp/registry/browser/product.py
@@ -40,6 +40,7 @@ __all__ = [
4040
4141
42from operator import attrgetter42from operator import attrgetter
43from urllib.parse import urlunsplit
4344
44from breezy import urlutils45from breezy import urlutils
45from breezy.revision import NULL_REVISION46from breezy.revision import NULL_REVISION
@@ -49,7 +50,6 @@ from lazr.restful.interface import (
49 use_template,50 use_template,
50 )51 )
51from lazr.restful.interfaces import IJSONRequestCache52from lazr.restful.interfaces import IJSONRequestCache
52from six.moves.urllib.parse import urlunsplit
53from zope.browserpage import ViewPageTemplateFile53from zope.browserpage import ViewPageTemplateFile
54from zope.component import getUtility54from zope.component import getUtility
55from zope.event import notify55from zope.event import notify
diff --git a/lib/lp/registry/browser/sourcepackage.py b/lib/lp/registry/browser/sourcepackage.py
index 43e6fb7..6eb7d3b 100644
--- a/lib/lp/registry/browser/sourcepackage.py
+++ b/lib/lp/registry/browser/sourcepackage.py
@@ -16,6 +16,7 @@ __all__ = [
16 ]16 ]
1717
18import string18import string
19from urllib.parse import urlencode
1920
20from apt_pkg import (21from apt_pkg import (
21 upstream_version,22 upstream_version,
@@ -26,7 +27,6 @@ from lazr.enum import (
26 Item,27 Item,
27 )28 )
28from lazr.restful.interface import copy_field29from lazr.restful.interface import copy_field
29from six.moves.urllib.parse import urlencode
30from zope.browserpage import ViewPageTemplateFile30from zope.browserpage import ViewPageTemplateFile
31from zope.component import (31from zope.component import (
32 adapter,32 adapter,
diff --git a/lib/lp/registry/browser/team.py b/lib/lp/registry/browser/team.py
index c37bbf0..c0e0be1 100644
--- a/lib/lp/registry/browser/team.py
+++ b/lib/lp/registry/browser/team.py
@@ -36,13 +36,13 @@ from datetime import (
36 timedelta,36 timedelta,
37 )37 )
38import math38import math
39from urllib.parse import unquote
3940
40from lazr.restful.interface import copy_field41from lazr.restful.interface import copy_field
41from lazr.restful.interfaces import IJSONRequestCache42from lazr.restful.interfaces import IJSONRequestCache
42from lazr.restful.utils import smartquote43from lazr.restful.utils import smartquote
43import pytz44import pytz
44import simplejson45import simplejson
45from six.moves.urllib.parse import unquote
46from zope.browserpage import ViewPageTemplateFile46from zope.browserpage import ViewPageTemplateFile
47from zope.component import getUtility47from zope.component import getUtility
48from zope.formlib.form import (48from zope.formlib.form import (
diff --git a/lib/lp/registry/browser/tests/test_distroseries.py b/lib/lp/registry/browser/tests/test_distroseries.py
index 326bbfd..505d2aa 100644
--- a/lib/lp/registry/browser/tests/test_distroseries.py
+++ b/lib/lp/registry/browser/tests/test_distroseries.py
@@ -7,15 +7,15 @@ from datetime import timedelta
7import difflib7import difflib
8import re8import re
9from textwrap import TextWrapper9from textwrap import TextWrapper
10from urllib.parse import (
11 urlencode,
12 urlparse,
13 )
1014
11from fixtures import FakeLogger15from fixtures import FakeLogger
12from lazr.restful.interfaces import IJSONRequestCache16from lazr.restful.interfaces import IJSONRequestCache
13from lxml import html17from lxml import html
14import six18import six
15from six.moves.urllib.parse import (
16 urlencode,
17 urlparse,
18 )
19import soupmatchers19import soupmatchers
20from storm.zope.interfaces import IResultSet20from storm.zope.interfaces import IResultSet
21from testtools.content import (21from testtools.content import (
diff --git a/lib/lp/registry/browser/tests/test_person.py b/lib/lp/registry/browser/tests/test_person.py
index 1a1624f..2f5eb23 100644
--- a/lib/lp/registry/browser/tests/test_person.py
+++ b/lib/lp/registry/browser/tests/test_person.py
@@ -6,10 +6,10 @@ import email
6from operator import attrgetter6from operator import attrgetter
7import re7import re
8from textwrap import dedent8from textwrap import dedent
9from urllib.parse import urljoin
910
10from fixtures import FakeLogger11from fixtures import FakeLogger
11import six12import six
12from six.moves.urllib.parse import urljoin
13import soupmatchers13import soupmatchers
14from storm.store import Store14from storm.store import Store
15from testscenarios import (15from testscenarios import (
diff --git a/lib/lp/registry/browser/tests/test_product.py b/lib/lp/registry/browser/tests/test_product.py
index c79cbd1..fadb04a 100644
--- a/lib/lp/registry/browser/tests/test_product.py
+++ b/lib/lp/registry/browser/tests/test_product.py
@@ -7,16 +7,16 @@ __all__ = ['make_product_form']
77
8import re8import re
9from textwrap import dedent9from textwrap import dedent
10from urllib.parse import (
11 urlencode,
12 urlsplit,
13 )
1014
11from lazr.restful.fields import Reference15from lazr.restful.fields import Reference
12from lazr.restful.interfaces import (16from lazr.restful.interfaces import (
13 IFieldMarshaller,17 IFieldMarshaller,
14 IJSONRequestCache,18 IJSONRequestCache,
15 )19 )
16from six.moves.urllib.parse import (
17 urlencode,
18 urlsplit,
19 )
20from soupmatchers import (20from soupmatchers import (
21 HTMLContains,21 HTMLContains,
22 Tag,22 Tag,
diff --git a/lib/lp/registry/browser/tests/test_sourcepackage_views.py b/lib/lp/registry/browser/tests/test_sourcepackage_views.py
index dcb66d0..2e4d2f7 100644
--- a/lib/lp/registry/browser/tests/test_sourcepackage_views.py
+++ b/lib/lp/registry/browser/tests/test_sourcepackage_views.py
@@ -3,10 +3,11 @@
33
4"""Tests for SourcePackage view code."""4"""Tests for SourcePackage view code."""
55
6from six.moves.urllib.parse import (6from urllib.parse import (
7 parse_qsl,7 parse_qsl,
8 splitquery,8 splitquery,
9 )9 )
10
10from soupmatchers import (11from soupmatchers import (
11 HTMLContains,12 HTMLContains,
12 Tag,13 Tag,
diff --git a/lib/lp/registry/scripts/distributionmirror_prober.py b/lib/lp/registry/scripts/distributionmirror_prober.py
index acd384d..00e1389 100644
--- a/lib/lp/registry/scripts/distributionmirror_prober.py
+++ b/lib/lp/registry/scripts/distributionmirror_prober.py
@@ -11,6 +11,12 @@ import io
11import itertools11import itertools
12import logging12import logging
13import os.path13import os.path
14from urllib.parse import (
15 unquote,
16 urljoin,
17 urlparse,
18 urlunparse,
19 )
1420
15import OpenSSL21import OpenSSL
16from OpenSSL.SSL import (22from OpenSSL.SSL import (
@@ -19,12 +25,6 @@ from OpenSSL.SSL import (
19 )25 )
20import requests26import requests
21import six27import six
22from six.moves.urllib.parse import (
23 unquote,
24 urljoin,
25 urlparse,
26 urlunparse,
27 )
28from treq.client import HTTPClient as TreqHTTPClient28from treq.client import HTTPClient as TreqHTTPClient
29from twisted.internet import (29from twisted.internet import (
30 defer,30 defer,
diff --git a/lib/lp/registry/scripts/productreleasefinder/finder.py b/lib/lp/registry/scripts/productreleasefinder/finder.py
index df79137..5d51c0c 100644
--- a/lib/lp/registry/scripts/productreleasefinder/finder.py
+++ b/lib/lp/registry/scripts/productreleasefinder/finder.py
@@ -11,10 +11,10 @@ import mimetypes
11import os11import os
12import re12import re
13import tempfile13import tempfile
14from urllib.parse import urlsplit
1415
15import pytz16import pytz
16import requests17import requests
17from six.moves.urllib.parse import urlsplit
18from zope.component import getUtility18from zope.component import getUtility
1919
20from lp.app.validators.name import invalid_name_pattern20from lp.app.validators.name import invalid_name_pattern
diff --git a/lib/lp/registry/scripts/productreleasefinder/walker.py b/lib/lp/registry/scripts/productreleasefinder/walker.py
index a7ee116..908dfd5 100644
--- a/lib/lp/registry/scripts/productreleasefinder/walker.py
+++ b/lib/lp/registry/scripts/productreleasefinder/walker.py
@@ -13,17 +13,17 @@ __all__ = [
1313
14import ftplib14import ftplib
15import os15import os
16from urllib.parse import (
17 unquote_plus,
18 urljoin,
19 urlsplit,
20 )
1621
17from lazr.uri import (22from lazr.uri import (
18 InvalidURIError,23 InvalidURIError,
19 URI,24 URI,
20 )25 )
21import requests26import requests
22from six.moves.urllib.parse import (
23 unquote_plus,
24 urljoin,
25 urlsplit,
26 )
2727
28from lp.registry.scripts.productreleasefinder import log28from lp.registry.scripts.productreleasefinder import log
29from lp.registry.scripts.productreleasefinder.path import (29from lp.registry.scripts.productreleasefinder.path import (
diff --git a/lib/lp/registry/stories/product/xx-product-files.txt b/lib/lp/registry/stories/product/xx-product-files.txt
index cb82bc6..34dd7cd 100644
--- a/lib/lp/registry/stories/product/xx-product-files.txt
+++ b/lib/lp/registry/stories/product/xx-product-files.txt
@@ -401,8 +401,8 @@ Downloading and deleting files
401401
402Download one of the files.402Download one of the files.
403403
404 >>> from six.moves.urllib.parse import urlparse404 >>> from urllib.parse import urlparse
405 >>> from six.moves.urllib.request import urlopen405 >>> from urllib.request import urlopen
406406
407XXX Downloading via the testbrowser does not work407XXX Downloading via the testbrowser does not work
408XXX unless the file is served by the Zope publisher.408XXX unless the file is served by the Zope publisher.
diff --git a/lib/lp/services/feeds/feed.py b/lib/lp/services/feeds/feed.py
index 9798bc0..b7e1467 100644
--- a/lib/lp/services/feeds/feed.py
+++ b/lib/lp/services/feeds/feed.py
@@ -18,8 +18,8 @@ __all__ = [
18import operator18import operator
19import os19import os
20import time20import time
21from urllib.parse import urljoin
2122
22from six.moves.urllib.parse import urljoin
23from zope.browserpage import ViewPageTemplateFile23from zope.browserpage import ViewPageTemplateFile
24from zope.component import getUtility24from zope.component import getUtility
25from zope.datetime import rfc1123_date25from zope.datetime import rfc1123_date
diff --git a/lib/lp/services/gpg/handler.py b/lib/lp/services/gpg/handler.py
index 005ca79..7dd60c9 100644
--- a/lib/lp/services/gpg/handler.py
+++ b/lib/lp/services/gpg/handler.py
@@ -18,13 +18,13 @@ import shutil
18import subprocess18import subprocess
19import sys19import sys
20import tempfile20import tempfile
21from urllib.parse import urlencode
2122
22import gpgme23import gpgme
23from lazr.restful.utils import get_current_browser_request24from lazr.restful.utils import get_current_browser_request
24import pytz25import pytz
25import requests26import requests
26import six27import six
27from six.moves.urllib.parse import urlencode
28from zope.component import getUtility28from zope.component import getUtility
29from zope.interface import implementer29from zope.interface import implementer
30from zope.security.proxy import removeSecurityProxy30from zope.security.proxy import removeSecurityProxy
diff --git a/lib/lp/services/librarian/client.py b/lib/lp/services/librarian/client.py
index a011bc3..0ef6028 100644
--- a/lib/lp/services/librarian/client.py
+++ b/lib/lp/services/librarian/client.py
@@ -21,20 +21,20 @@ from socket import (
21 )21 )
22import threading22import threading
23import time23import time
2424from urllib.error import (
25from lazr.restful.utils import get_current_browser_request
26import six
27from six.moves.urllib.error import (
28 HTTPError,25 HTTPError,
29 URLError,26 URLError,
30 )27 )
31from six.moves.urllib.parse import (28from urllib.parse import (
32 quote,29 quote,
33 urljoin,30 urljoin,
34 urlparse,31 urlparse,
35 urlunparse,32 urlunparse,
36 )33 )
37from six.moves.urllib.request import urlopen34from urllib.request import urlopen
35
36from lazr.restful.utils import get_current_browser_request
37import six
38from storm.store import Store38from storm.store import Store
39from zope.interface import implementer39from zope.interface import implementer
4040
diff --git a/lib/lp/services/librarian/doc/librarian.txt b/lib/lp/services/librarian/doc/librarian.txt
index 6c41957..b5c3daf 100644
--- a/lib/lp/services/librarian/doc/librarian.txt
+++ b/lib/lp/services/librarian/doc/librarian.txt
@@ -252,7 +252,7 @@ the client until it begins a new transaction.
252 >>> print(url)252 >>> print(url)
253 http://.../text.txt253 http://.../text.txt
254254
255 >>> from six.moves.urllib.request import urlopen255 >>> from urllib.request import urlopen
256 >>> six.ensure_str(urlopen(url).read())256 >>> six.ensure_str(urlopen(url).read())
257 'This is some data'257 'This is some data'
258258
diff --git a/lib/lp/services/librarian/model.py b/lib/lp/services/librarian/model.py
index 6b0ea19..bf27020 100644
--- a/lib/lp/services/librarian/model.py
+++ b/lib/lp/services/librarian/model.py
@@ -12,10 +12,10 @@ __all__ = [
1212
13from datetime import datetime13from datetime import datetime
14import hashlib14import hashlib
15from urllib.parse import urlparse
1516
16from lazr.delegates import delegate_to17from lazr.delegates import delegate_to
17import pytz18import pytz
18from six.moves.urllib.parse import urlparse
19from storm.locals import (19from storm.locals import (
20 Date,20 Date,
21 Desc,21 Desc,
diff --git a/lib/lp/services/librarian/smoketest.py b/lib/lp/services/librarian/smoketest.py
index 5fd3a2b..8b4ba38 100644
--- a/lib/lp/services/librarian/smoketest.py
+++ b/lib/lp/services/librarian/smoketest.py
@@ -9,9 +9,9 @@
9import datetime9import datetime
10import io10import io
11import sys11import sys
12from urllib.request import urlopen
1213
13import pytz14import pytz
14from six.moves.urllib.request import urlopen
15import transaction15import transaction
16from zope.component import getUtility16from zope.component import getUtility
1717
diff --git a/lib/lp/services/librarian/tests/test_client.py b/lib/lp/services/librarian/tests/test_client.py
index 6bef538..2fef0cf 100644
--- a/lib/lp/services/librarian/tests/test_client.py
+++ b/lib/lp/services/librarian/tests/test_client.py
@@ -10,16 +10,16 @@ import socket
10import textwrap10import textwrap
11import threading11import threading
12import unittest12import unittest
13from urllib.error import (
14 HTTPError,
15 URLError,
16 )
17from urllib.request import urlopen
1318
14from fixtures import (19from fixtures import (
15 EnvironmentVariable,20 EnvironmentVariable,
16 TempDir,21 TempDir,
17 )22 )
18from six.moves.urllib.error import (
19 HTTPError,
20 URLError,
21 )
22from six.moves.urllib.request import urlopen
23from testtools.testcase import ExpectedException23from testtools.testcase import ExpectedException
24import transaction24import transaction
2525
diff --git a/lib/lp/services/librarianserver/db.py b/lib/lp/services/librarianserver/db.py
index 4ed2901..3c0d9d0 100644
--- a/lib/lp/services/librarianserver/db.py
+++ b/lib/lp/services/librarianserver/db.py
@@ -8,13 +8,13 @@ __all__ = [
8 ]8 ]
99
10import hashlib10import hashlib
11from xmlrpc.client import Fault11from urllib.parse import (
12
13from pymacaroons import Macaroon
14from six.moves.urllib.parse import (
15 quote,12 quote,
16 unquote,13 unquote,
17 )14 )
15from xmlrpc.client import Fault
16
17from pymacaroons import Macaroon
18from storm.expr import (18from storm.expr import (
19 And,19 And,
20 SQL,20 SQL,
diff --git a/lib/lp/services/librarianserver/swift.py b/lib/lp/services/librarianserver/swift.py
index bd22a1e..87bee7b 100644
--- a/lib/lp/services/librarianserver/swift.py
+++ b/lib/lp/services/librarianserver/swift.py
@@ -19,8 +19,8 @@ import hashlib
19import os.path19import os.path
20import re20import re
21import time21import time
22from urllib.parse import quote
2223
23from six.moves.urllib.parse import quote
24from swiftclient import client as swiftclient24from swiftclient import client as swiftclient
2525
26from lp.services.config import config26from lp.services.config import config
diff --git a/lib/lp/services/librarianserver/testing/fake.py b/lib/lp/services/librarianserver/testing/fake.py
index b18f9a9..59ed31b 100644
--- a/lib/lp/services/librarianserver/testing/fake.py
+++ b/lib/lp/services/librarianserver/testing/fake.py
@@ -16,9 +16,9 @@ __all__ = [
1616
17import hashlib17import hashlib
18import io18import io
19from urllib.parse import urljoin
1920
20from fixtures import Fixture21from fixtures import Fixture
21from six.moves.urllib.parse import urljoin
22import transaction22import transaction
23from transaction.interfaces import ISynchronizer23from transaction.interfaces import ISynchronizer
24import zope.component24import zope.component
diff --git a/lib/lp/services/librarianserver/testing/tests/test_server_fixture.py b/lib/lp/services/librarianserver/testing/tests/test_server_fixture.py
index 86a6619..bd617e9 100644
--- a/lib/lp/services/librarianserver/testing/tests/test_server_fixture.py
+++ b/lib/lp/services/librarianserver/testing/tests/test_server_fixture.py
@@ -6,8 +6,7 @@
6import os6import os
7import socket7import socket
8from textwrap import dedent8from textwrap import dedent
99from urllib.request import urlopen
10from six.moves.urllib.request import urlopen
1110
12from lp.services.config import config11from lp.services.config import config
13from lp.services.config.fixture import ConfigFixture12from lp.services.config.fixture import ConfigFixture
diff --git a/lib/lp/services/librarianserver/tests/test_db_outage.py b/lib/lp/services/librarianserver/tests/test_db_outage.py
index 5709cd9..7887632 100644
--- a/lib/lp/services/librarianserver/tests/test_db_outage.py
+++ b/lib/lp/services/librarianserver/tests/test_db_outage.py
@@ -6,10 +6,10 @@
6Database outages happen by accident and during fastdowntime deployments."""6Database outages happen by accident and during fastdowntime deployments."""
77
8import io8import io
9from urllib.error import HTTPError
10from urllib.request import urlopen
911
10from fixtures import Fixture12from fixtures import Fixture
11from six.moves.urllib.error import HTTPError
12from six.moves.urllib.request import urlopen
1313
14from lp.services.librarian.client import LibrarianClient14from lp.services.librarian.client import LibrarianClient
15from lp.services.librarianserver.testing.server import LibrarianServerFixture15from lp.services.librarianserver.testing.server import LibrarianServerFixture
diff --git a/lib/lp/services/librarianserver/tests/test_gc.py b/lib/lp/services/librarianserver/tests/test_gc.py
index 7e1eedb..850f9ae 100644
--- a/lib/lp/services/librarianserver/tests/test_gc.py
+++ b/lib/lp/services/librarianserver/tests/test_gc.py
@@ -19,11 +19,11 @@ from subprocess import (
19 STDOUT,19 STDOUT,
20 )20 )
21import tempfile21import tempfile
22from urllib.parse import urljoin
2223
23from fixtures import MockPatchObject24from fixtures import MockPatchObject
24import pytz25import pytz
25import requests26import requests
26from six.moves.urllib.parse import urljoin
27from storm.store import Store27from storm.store import Store
28from swiftclient import client as swiftclient28from swiftclient import client as swiftclient
29from testtools.matchers import (29from testtools.matchers import (
diff --git a/lib/lp/services/librarianserver/tests/test_web.py b/lib/lp/services/librarianserver/tests/test_web.py
index 5800724..1fe9c22 100644
--- a/lib/lp/services/librarianserver/tests/test_web.py
+++ b/lib/lp/services/librarianserver/tests/test_web.py
@@ -8,11 +8,11 @@ import http.client
8from io import BytesIO8from io import BytesIO
9import os9import os
10import unittest10import unittest
11from urllib.parse import urlparse
1112
12from lazr.uri import URI13from lazr.uri import URI
13import pytz14import pytz
14import requests15import requests
15from six.moves.urllib.parse import urlparse
16from storm.expr import SQL16from storm.expr import SQL
17from testtools.matchers import EndsWith17from testtools.matchers import EndsWith
18import transaction18import transaction
diff --git a/lib/lp/services/librarianserver/web.py b/lib/lp/services/librarianserver/web.py
index b40536f..989e043 100644
--- a/lib/lp/services/librarianserver/web.py
+++ b/lib/lp/services/librarianserver/web.py
@@ -3,10 +3,10 @@
33
4from datetime import datetime4from datetime import datetime
5import time5import time
6from urllib.parse import urlparse
67
7from pymacaroons import Macaroon8from pymacaroons import Macaroon
8import six9import six
9from six.moves.urllib.parse import urlparse
10from storm.exceptions import DisconnectionError10from storm.exceptions import DisconnectionError
11from twisted.internet import (11from twisted.internet import (
12 abstract,12 abstract,
diff --git a/lib/lp/services/oauth/stories/access-token.txt b/lib/lp/services/oauth/stories/access-token.txt
index a56ee3c..86c5241 100644
--- a/lib/lp/services/oauth/stories/access-token.txt
+++ b/lib/lp/services/oauth/stories/access-token.txt
@@ -19,7 +19,7 @@ access token.
19 >>> token.review(salgado, OAuthPermission.WRITE_PUBLIC)19 >>> token.review(salgado, OAuthPermission.WRITE_PUBLIC)
20 >>> logout()20 >>> logout()
2121
22 >>> from six.moves.urllib.parse import urlencode22 >>> from urllib.parse import urlencode
23 >>> data = dict(23 >>> data = dict(
24 ... oauth_consumer_key='foobar123451432',24 ... oauth_consumer_key='foobar123451432',
25 ... oauth_version='1.0',25 ... oauth_version='1.0',
diff --git a/lib/lp/services/oauth/stories/authorize-token.txt b/lib/lp/services/oauth/stories/authorize-token.txt
index 6634a7a..ecd2e7a 100644
--- a/lib/lp/services/oauth/stories/authorize-token.txt
+++ b/lib/lp/services/oauth/stories/authorize-token.txt
@@ -31,7 +31,7 @@ The +authorize-token page is restricted to logged in users, so users will
31first be asked to log in. (We won't show the actual login process because31first be asked to log in. (We won't show the actual login process because
32it involves OpenID, which would complicate this test quite a bit.)32it involves OpenID, which would complicate this test quite a bit.)
3333
34 >>> from six.moves.urllib.parse import urlencode34 >>> from urllib.parse import urlencode
35 >>> params = dict(35 >>> params = dict(
36 ... oauth_token=token.key, oauth_callback='http://launchpad.test/bzr')36 ... oauth_token=token.key, oauth_callback='http://launchpad.test/bzr')
37 >>> url = "http://launchpad.test/+authorize-token?%s" % urlencode(params)37 >>> url = "http://launchpad.test/+authorize-token?%s" % urlencode(params)
diff --git a/lib/lp/services/oauth/stories/request-token.txt b/lib/lp/services/oauth/stories/request-token.txt
index 3e9b4cb..dc1b001 100644
--- a/lib/lp/services/oauth/stories/request-token.txt
+++ b/lib/lp/services/oauth/stories/request-token.txt
@@ -4,7 +4,7 @@ Asking for a request token
4Our sample consumer (whose key is 'foobar123451432') asks Launchpad for4Our sample consumer (whose key is 'foobar123451432') asks Launchpad for
5a request token which may later be exchanged for an access token.5a request token which may later be exchanged for an access token.
66
7 >>> from six.moves.urllib.parse import urlencode7 >>> from urllib.parse import urlencode
8 >>> data = dict(8 >>> data = dict(
9 ... oauth_consumer_key='foobar123451432',9 ... oauth_consumer_key='foobar123451432',
10 ... oauth_version='1.0',10 ... oauth_version='1.0',
diff --git a/lib/lp/services/openid/fetcher.py b/lib/lp/services/openid/fetcher.py
index 88343a1..a32e0f7 100644
--- a/lib/lp/services/openid/fetcher.py
+++ b/lib/lp/services/openid/fetcher.py
@@ -9,12 +9,12 @@ __all__ = [
99
10from functools import partial10from functools import partial
11import os.path11import os.path
12from urllib.request import urlopen
1213
13from openid.fetchers import (14from openid.fetchers import (
14 setDefaultFetcher,15 setDefaultFetcher,
15 Urllib2Fetcher,16 Urllib2Fetcher,
16 )17 )
17from six.moves.urllib.request import urlopen
1818
19from lp.services.config import config19from lp.services.config import config
20from lp.services.encoding import wsgi_native_string20from lp.services.encoding import wsgi_native_string
diff --git a/lib/lp/services/scripts/base.py b/lib/lp/services/scripts/base.py
index 9abdbb2..62dc799 100644
--- a/lib/lp/services/scripts/base.py
+++ b/lib/lp/services/scripts/base.py
@@ -19,6 +19,10 @@ import logging
19from optparse import OptionParser19from optparse import OptionParser
20import os.path20import os.path
21import sys21import sys
22from urllib.parse import (
23 urlparse,
24 urlunparse,
25 )
2226
23from contrib.glock import (27from contrib.glock import (
24 GlobalLock,28 GlobalLock,
@@ -26,10 +30,6 @@ from contrib.glock import (
26 )30 )
27import pytz31import pytz
28import requests32import requests
29from six.moves.urllib.parse import (
30 urlparse,
31 urlunparse,
32 )
33import transaction33import transaction
34from zope.component import getUtility34from zope.component import getUtility
3535
diff --git a/lib/lp/services/signing/proxy.py b/lib/lp/services/signing/proxy.py
index 0e5fded..5bd23ba 100644
--- a/lib/lp/services/signing/proxy.py
+++ b/lib/lp/services/signing/proxy.py
@@ -5,6 +5,7 @@
55
6import base646import base64
7import json7import json
8from urllib.parse import urljoin
89
9from lazr.restful.utils import get_current_browser_request10from lazr.restful.utils import get_current_browser_request
10from nacl.encoding import Base64Encoder11from nacl.encoding import Base64Encoder
@@ -14,7 +15,6 @@ from nacl.public import (
14 PublicKey,15 PublicKey,
15 )16 )
16from nacl.utils import random17from nacl.utils import random
17from six.moves.urllib.parse import urljoin
18from zope.interface import implementer18from zope.interface import implementer
1919
20from lp.services.config import config20from lp.services.config import config
diff --git a/lib/lp/services/sitesearch/__init__.py b/lib/lp/services/sitesearch/__init__.py
index 074c1a1..9c04b05 100644
--- a/lib/lp/services/sitesearch/__init__.py
+++ b/lib/lp/services/sitesearch/__init__.py
@@ -9,14 +9,15 @@ __all__ = [
9 'PageMatches',9 'PageMatches',
10 ]10 ]
1111
12from lazr.restful.utils import get_current_browser_request12from urllib.parse import (
13from lazr.uri import URI
14import requests
15from six.moves.urllib.parse import (
16 parse_qsl,13 parse_qsl,
17 urlencode,14 urlencode,
18 urlunparse,15 urlunparse,
19 )16 )
17
18from lazr.restful.utils import get_current_browser_request
19from lazr.uri import URI
20import requests
20from zope.interface import implementer21from zope.interface import implementer
2122
22from lp.services.config import config23from lp.services.config import config
diff --git a/lib/lp/services/verification/browser/logintoken.py b/lib/lp/services/verification/browser/logintoken.py
index 8d13422..a9004d4 100644
--- a/lib/lp/services/verification/browser/logintoken.py
+++ b/lib/lp/services/verification/browser/logintoken.py
@@ -13,10 +13,11 @@ __all__ = [
13 'ValidateGPGKeyView',13 'ValidateGPGKeyView',
14 ]14 ]
1515
16from six.moves.urllib.parse import (16from urllib.parse import (
17 urlencode,17 urlencode,
18 urljoin,18 urljoin,
19 )19 )
20
20from zope.component import getUtility21from zope.component import getUtility
21from zope.formlib.widget import CustomWidgetFactory22from zope.formlib.widget import CustomWidgetFactory
22from zope.formlib.widgets import TextAreaWidget23from zope.formlib.widgets import TextAreaWidget
diff --git a/lib/lp/services/webapp/doc/webapp-publication.txt b/lib/lp/services/webapp/doc/webapp-publication.txt
index d7f8dcc..430ead9 100644
--- a/lib/lp/services/webapp/doc/webapp-publication.txt
+++ b/lib/lp/services/webapp/doc/webapp-publication.txt
@@ -507,7 +507,7 @@ python 'in' operator.
507507
508 >>> from lp.services.webapp.servers import (508 >>> from lp.services.webapp.servers import (
509 ... LaunchpadBrowserRequest)509 ... LaunchpadBrowserRequest)
510 >>> from six.moves.urllib.parse import urlencode510 >>> from urllib.parse import urlencode
511 >>> environment = {'QUERY_STRING': urlencode({511 >>> environment = {'QUERY_STRING': urlencode({
512 ... 'a_field': 'a_value',512 ... 'a_field': 'a_value',
513 ... 'items_field': [1, 2, 3]}, doseq=True)}513 ... 'items_field': [1, 2, 3]}, doseq=True)}
diff --git a/lib/lp/services/webapp/errorlog.py b/lib/lp/services/webapp/errorlog.py
index 7327c8f..82e698f 100644
--- a/lib/lp/services/webapp/errorlog.py
+++ b/lib/lp/services/webapp/errorlog.py
@@ -7,6 +7,7 @@ import contextlib
7from itertools import repeat7from itertools import repeat
8import operator8import operator
9import re9import re
10from urllib.parse import urlparse
1011
11from lazr.restful.utils import get_current_browser_request12from lazr.restful.utils import get_current_browser_request
12import oops.createhooks13import oops.createhooks
@@ -15,7 +16,6 @@ from oops_datedir_repo import DateDirRepo
15import oops_timeline16import oops_timeline
16import pytz17import pytz
17import six18import six
18from six.moves.urllib.parse import urlparse
19from talisker.logs import logging_context19from talisker.logs import logging_context
20from zope.component import getUtility20from zope.component import getUtility
21from zope.error.interfaces import IErrorReportingUtility21from zope.error.interfaces import IErrorReportingUtility
diff --git a/lib/lp/services/webapp/login.py b/lib/lp/services/webapp/login.py
index 08e693a..0060ab7 100644
--- a/lib/lp/services/webapp/login.py
+++ b/lib/lp/services/webapp/login.py
@@ -6,6 +6,7 @@ from datetime import (
6 datetime,6 datetime,
7 timedelta,7 timedelta,
8 )8 )
9from urllib.parse import urlencode
910
10from openid.consumer.consumer import (11from openid.consumer.consumer import (
11 CANCEL,12 CANCEL,
@@ -22,7 +23,6 @@ from paste.httpexceptions import (
22 HTTPException,23 HTTPException,
23 )24 )
24import six25import six
25from six.moves.urllib.parse import urlencode
26import transaction26import transaction
27from zope.authentication.interfaces import IUnauthenticatedPrincipal27from zope.authentication.interfaces import IUnauthenticatedPrincipal
28from zope.browserpage import ViewPageTemplateFile28from zope.browserpage import ViewPageTemplateFile
diff --git a/lib/lp/services/webapp/publication.py b/lib/lp/services/webapp/publication.py
index 37cd383..6f2690d 100644
--- a/lib/lp/services/webapp/publication.py
+++ b/lib/lp/services/webapp/publication.py
@@ -11,13 +11,13 @@ import sys
11import threading11import threading
12import time12import time
13import traceback13import traceback
14from urllib.parse import quote
1415
15from lazr.uri import (16from lazr.uri import (
16 InvalidURIError,17 InvalidURIError,
17 URI,18 URI,
18 )19 )
19from psycopg2.extensions import TransactionRollbackError20from psycopg2.extensions import TransactionRollbackError
20from six.moves.urllib.parse import quote
21from storm.database import STATE_DISCONNECTED21from storm.database import STATE_DISCONNECTED
22from storm.exceptions import (22from storm.exceptions import (
23 DisconnectionError,23 DisconnectionError,
diff --git a/lib/lp/services/webapp/publisher.py b/lib/lp/services/webapp/publisher.py
index 2f5960d..397c873 100644
--- a/lib/lp/services/webapp/publisher.py
+++ b/lib/lp/services/webapp/publisher.py
@@ -28,6 +28,7 @@ __all__ = [
28from cgi import FieldStorage28from cgi import FieldStorage
29import http.client29import http.client
30import re30import re
31from urllib.parse import urlparse
31from wsgiref.headers import Headers32from wsgiref.headers import Headers
3233
33from lazr.restful import (34from lazr.restful import (
@@ -41,7 +42,6 @@ from lazr.restful.tales import WebLayerAPI
41from lazr.restful.utils import get_current_browser_request42from lazr.restful.utils import get_current_browser_request
42import simplejson43import simplejson
43import six44import six
44from six.moves.urllib.parse import urlparse
45from zope.app.publisher.xmlrpc import IMethodPublisher45from zope.app.publisher.xmlrpc import IMethodPublisher
46from zope.component import (46from zope.component import (
47 getUtility,47 getUtility,
diff --git a/lib/lp/services/webapp/servers.py b/lib/lp/services/webapp/servers.py
index e644e05..79888bd 100644
--- a/lib/lp/services/webapp/servers.py
+++ b/lib/lp/services/webapp/servers.py
@@ -4,6 +4,7 @@
4"""Definition of the internet servers that Launchpad uses."""4"""Definition of the internet servers that Launchpad uses."""
55
6import threading6import threading
7from urllib.parse import parse_qs
7import xmlrpc.client8import xmlrpc.client
89
9from lazr.restful.interfaces import (10from lazr.restful.interfaces import (
@@ -18,7 +19,6 @@ from lazr.restful.publisher import (
18from lazr.restful.utils import get_current_browser_request19from lazr.restful.utils import get_current_browser_request
19from lazr.uri import URI20from lazr.uri import URI
20import six21import six
21from six.moves.urllib.parse import parse_qs
22from talisker.logs import logging_context22from talisker.logs import logging_context
23import transaction23import transaction
24from transaction.interfaces import ISynchronizer24from transaction.interfaces import ISynchronizer
diff --git a/lib/lp/services/webapp/tests/test_error.py b/lib/lp/services/webapp/tests/test_error.py
index 2081b14..eae2756 100644
--- a/lib/lp/services/webapp/tests/test_error.py
+++ b/lib/lp/services/webapp/tests/test_error.py
@@ -7,10 +7,10 @@ import http.client
7import logging7import logging
8import socket8import socket
9import time9import time
10from urllib.error import HTTPError
1011
11from fixtures import FakeLogger12from fixtures import FakeLogger
12import psycopg213import psycopg2
13from six.moves.urllib.error import HTTPError
14from storm.exceptions import (14from storm.exceptions import (
15 DisconnectionError,15 DisconnectionError,
16 OperationalError,16 OperationalError,
diff --git a/lib/lp/services/webapp/tests/test_login.py b/lib/lp/services/webapp/tests/test_login.py
index 61357d4..1cfec2d 100644
--- a/lib/lp/services/webapp/tests/test_login.py
+++ b/lib/lp/services/webapp/tests/test_login.py
@@ -17,6 +17,12 @@ from datetime import (
17 )17 )
18import http.client18import http.client
19import unittest19import unittest
20from urllib.error import HTTPError
21from urllib.parse import (
22 parse_qsl,
23 quote,
24 urlsplit,
25 )
2026
21from openid.consumer.consumer import (27from openid.consumer.consumer import (
22 FAILURE,28 FAILURE,
@@ -27,12 +33,6 @@ from openid.extensions import (
27 sreg,33 sreg,
28 )34 )
29from openid.yadis.discover import DiscoveryFailure35from openid.yadis.discover import DiscoveryFailure
30from six.moves.urllib.error import HTTPError
31from six.moves.urllib.parse import (
32 parse_qsl,
33 quote,
34 urlsplit,
35 )
36from testtools.matchers import (36from testtools.matchers import (
37 Contains,37 Contains,
38 ContainsDict,38 ContainsDict,
diff --git a/lib/lp/services/webapp/tests/test_login_account.py b/lib/lp/services/webapp/tests/test_login_account.py
index 6d6f535..550a7ae 100644
--- a/lib/lp/services/webapp/tests/test_login_account.py
+++ b/lib/lp/services/webapp/tests/test_login_account.py
@@ -2,9 +2,9 @@
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4from datetime import datetime4from datetime import datetime
5from urllib.parse import parse_qs
56
6import lazr.uri7import lazr.uri
7from six.moves.urllib.parse import parse_qs
8from zope.component import getUtility8from zope.component import getUtility
9from zope.event import notify9from zope.event import notify
10from zope.session.interfaces import ISession10from zope.session.interfaces import ISession
diff --git a/lib/lp/services/webapp/url.py b/lib/lp/services/webapp/url.py
index a6f15b5..e3932d5 100644
--- a/lib/lp/services/webapp/url.py
+++ b/lib/lp/services/webapp/url.py
@@ -5,8 +5,8 @@
55
6__all__ = ['urlappend', 'urlparse', 'urlsplit']6__all__ = ['urlappend', 'urlparse', 'urlsplit']
77
8import six.moves.urllib.parse as urlparse_module8import urllib.parse as urlparse_module
9from six.moves.urllib.parse import (9from urllib.parse import (
10 urljoin,10 urljoin,
11 urlparse as original_urlparse,11 urlparse as original_urlparse,
12 urlsplit as original_urlsplit,12 urlsplit as original_urlsplit,
diff --git a/lib/lp/services/webhooks/model.py b/lib/lp/services/webhooks/model.py
index aed49ae..e8518db 100644
--- a/lib/lp/services/webhooks/model.py
+++ b/lib/lp/services/webhooks/model.py
@@ -15,6 +15,7 @@ from datetime import (
15import ipaddress15import ipaddress
16import re16import re
17import socket17import socket
18from urllib.parse import urlsplit
1819
19import iso860120import iso8601
20from lazr.delegates import delegate_to21from lazr.delegates import delegate_to
@@ -24,7 +25,6 @@ from lazr.enum import (
24 )25 )
25import psutil26import psutil
26from pytz import utc27from pytz import utc
27from six.moves.urllib.parse import urlsplit
28from storm.expr import Desc28from storm.expr import Desc
29from storm.properties import (29from storm.properties import (
30 Bool,30 Bool,
diff --git a/lib/lp/services/webservice/wadl.py b/lib/lp/services/webservice/wadl.py
index 5432f26..bcbf3bf 100644
--- a/lib/lp/services/webservice/wadl.py
+++ b/lib/lp/services/webservice/wadl.py
@@ -7,9 +7,9 @@ try:
7 from importlib import resources7 from importlib import resources
8except ImportError:8except ImportError:
9 import importlib_resources as resources9 import importlib_resources as resources
10import subprocess
1110
12from six.moves.urllib.parse import urljoin11import subprocess
12from urllib.parse import urljoin
1313
14from lp.services.webapp.interaction import (14from lp.services.webapp.interaction import (
15 ANONYMOUS,15 ANONYMOUS,
diff --git a/lib/lp/snappy/browser/snap.py b/lib/lp/snappy/browser/snap.py
index 0fc63ca..eccbcd8 100644
--- a/lib/lp/snappy/browser/snap.py
+++ b/lib/lp/snappy/browser/snap.py
@@ -15,12 +15,13 @@ __all__ = [
15 'SnapView',15 'SnapView',
16 ]16 ]
1717
18from urllib.parse import urlencode
19
18from lazr.restful.fields import Reference20from lazr.restful.fields import Reference
19from lazr.restful.interface import (21from lazr.restful.interface import (
20 copy_field,22 copy_field,
21 use_template,23 use_template,
22 )24 )
23from six.moves.urllib.parse import urlencode
24from zope.component import getUtility25from zope.component import getUtility
25from zope.error.interfaces import IErrorReportingUtility26from zope.error.interfaces import IErrorReportingUtility
26from zope.formlib.widget import CustomWidgetFactory27from zope.formlib.widget import CustomWidgetFactory
diff --git a/lib/lp/snappy/browser/tests/test_snap.py b/lib/lp/snappy/browser/tests/test_snap.py
index c513111..bbc0be7 100644
--- a/lib/lp/snappy/browser/tests/test_snap.py
+++ b/lib/lp/snappy/browser/tests/test_snap.py
@@ -9,15 +9,15 @@ from datetime import (
9 )9 )
10import json10import json
11import re11import re
12from urllib.parse import (
13 parse_qs,
14 urlsplit,
15 )
1216
13from fixtures import FakeLogger17from fixtures import FakeLogger
14from pymacaroons import Macaroon18from pymacaroons import Macaroon
15import pytz19import pytz
16import responses20import responses
17from six.moves.urllib.parse import (
18 parse_qs,
19 urlsplit,
20 )
21import soupmatchers21import soupmatchers
22from testtools.matchers import (22from testtools.matchers import (
23 AfterPreprocessing,23 AfterPreprocessing,
diff --git a/lib/lp/snappy/model/snap.py b/lib/lp/snappy/model/snap.py
index 1a2bf68..16bbfed 100644
--- a/lib/lp/snappy/model/snap.py
+++ b/lib/lp/snappy/model/snap.py
@@ -13,13 +13,13 @@ from datetime import (
13 timedelta,13 timedelta,
14 )14 )
15from operator import attrgetter15from operator import attrgetter
16from urllib.parse import urlsplit
1617
17from breezy import urlutils18from breezy import urlutils
18from lazr.lifecycle.event import ObjectCreatedEvent19from lazr.lifecycle.event import ObjectCreatedEvent
19from pymacaroons import Macaroon20from pymacaroons import Macaroon
20import pytz21import pytz
21import six22import six
22from six.moves.urllib.parse import urlsplit
23from storm.expr import (23from storm.expr import (
24 And,24 And,
25 Coalesce,25 Coalesce,
diff --git a/lib/lp/snappy/model/snapstoreclient.py b/lib/lp/snappy/model/snapstoreclient.py
index e5900fc..b56f5b6 100644
--- a/lib/lp/snappy/model/snapstoreclient.py
+++ b/lib/lp/snappy/model/snapstoreclient.py
@@ -11,13 +11,13 @@ import base64
11import json11import json
12import string12import string
13import time13import time
14from urllib.parse import urlsplit
1415
15from lazr.restful.utils import get_current_browser_request16from lazr.restful.utils import get_current_browser_request
16from pymacaroons import Macaroon17from pymacaroons import Macaroon
17import requests18import requests
18from requests_toolbelt import MultipartEncoder19from requests_toolbelt import MultipartEncoder
19import six20import six
20from six.moves.urllib.parse import urlsplit
21from zope.component import getUtility21from zope.component import getUtility
22from zope.interface import implementer22from zope.interface import implementer
23from zope.security.proxy import removeSecurityProxy23from zope.security.proxy import removeSecurityProxy
diff --git a/lib/lp/snappy/tests/test_snap.py b/lib/lp/snappy/tests/test_snap.py
index 7d8d45e..0dae2d5 100644
--- a/lib/lp/snappy/tests/test_snap.py
+++ b/lib/lp/snappy/tests/test_snap.py
@@ -11,6 +11,7 @@ from datetime import (
11import json11import json
12from operator import attrgetter12from operator import attrgetter
13from textwrap import dedent13from textwrap import dedent
14from urllib.parse import urlsplit
1415
15from fixtures import (16from fixtures import (
16 FakeLogger,17 FakeLogger,
@@ -21,7 +22,6 @@ from nacl.public import PrivateKey
21from pymacaroons import Macaroon22from pymacaroons import Macaroon
22import pytz23import pytz
23import responses24import responses
24from six.moves.urllib.parse import urlsplit
25from storm.exceptions import LostObjectError25from storm.exceptions import LostObjectError
26from storm.locals import Store26from storm.locals import Store
27from testtools.matchers import (27from testtools.matchers import (
diff --git a/lib/lp/snappy/tests/test_snapbuild.py b/lib/lp/snappy/tests/test_snapbuild.py
index 0cf70ac..f11a097 100644
--- a/lib/lp/snappy/tests/test_snapbuild.py
+++ b/lib/lp/snappy/tests/test_snapbuild.py
@@ -7,12 +7,12 @@ from datetime import (
7 datetime,7 datetime,
8 timedelta,8 timedelta,
9 )9 )
10from urllib.request import urlopen
1011
11from fixtures import FakeLogger12from fixtures import FakeLogger
12from pymacaroons import Macaroon13from pymacaroons import Macaroon
13import pytz14import pytz
14import six15import six
15from six.moves.urllib.request import urlopen
16from testtools.matchers import (16from testtools.matchers import (
17 ContainsDict,17 ContainsDict,
18 Equals,18 Equals,
diff --git a/lib/lp/snappy/tests/test_snapbuildbehaviour.py b/lib/lp/snappy/tests/test_snapbuildbehaviour.py
index d1836e1..db202cb 100644
--- a/lib/lp/snappy/tests/test_snapbuildbehaviour.py
+++ b/lib/lp/snappy/tests/test_snapbuildbehaviour.py
@@ -8,13 +8,13 @@ from datetime import datetime
8import os.path8import os.path
9from textwrap import dedent9from textwrap import dedent
10import time10import time
11from urllib.parse import urlsplit
11import uuid12import uuid
1213
13from aptsources.sourceslist import SourceEntry14from aptsources.sourceslist import SourceEntry
14import fixtures15import fixtures
15from pymacaroons import Macaroon16from pymacaroons import Macaroon
16import pytz17import pytz
17from six.moves.urllib_parse import urlsplit
18from testtools import ExpectedException18from testtools import ExpectedException
19from testtools.matchers import (19from testtools.matchers import (
20 AfterPreprocessing,20 AfterPreprocessing,
diff --git a/lib/lp/soyuz/browser/widgets/archive.py b/lib/lp/soyuz/browser/widgets/archive.py
index 17d0947..73a279f 100644
--- a/lib/lp/soyuz/browser/widgets/archive.py
+++ b/lib/lp/soyuz/browser/widgets/archive.py
@@ -7,7 +7,7 @@ __all__ = [
7 'PPANameWidget',7 'PPANameWidget',
8 ]8 ]
99
10from six.moves.urllib.parse import urljoin10from urllib.parse import urljoin
1111
12from lp.app.widgets.textwidgets import URIComponentWidget12from lp.app.widgets.textwidgets import URIComponentWidget
13from lp.services.config import config13from lp.services.config import config
diff --git a/lib/lp/soyuz/interfaces/archive.py b/lib/lp/soyuz/interfaces/archive.py
index da4b948..e011591 100644
--- a/lib/lp/soyuz/interfaces/archive.py
+++ b/lib/lp/soyuz/interfaces/archive.py
@@ -54,6 +54,7 @@ __all__ = [
5454
55import http.client55import http.client
56import re56import re
57from urllib.parse import urlparse
5758
58from lazr.restful.declarations import (59from lazr.restful.declarations import (
59 call_with,60 call_with,
@@ -78,7 +79,6 @@ from lazr.restful.fields import (
78 CollectionField,79 CollectionField,
79 Reference,80 Reference,
80 )81 )
81from six.moves.urllib.parse import urlparse
82from zope.interface import (82from zope.interface import (
83 Attribute,83 Attribute,
84 Interface,84 Interface,
diff --git a/lib/lp/soyuz/scripts/ppa_apache_log_parser.py b/lib/lp/soyuz/scripts/ppa_apache_log_parser.py
index 64bfcd1..c8c1e58 100644
--- a/lib/lp/soyuz/scripts/ppa_apache_log_parser.py
+++ b/lib/lp/soyuz/scripts/ppa_apache_log_parser.py
@@ -4,8 +4,7 @@
4__all__ = ['DBUSER', 'get_ppa_file_key']4__all__ = ['DBUSER', 'get_ppa_file_key']
55
6import os.path6import os.path
77from urllib.parse import unquote
8from six.moves.urllib.parse import unquote
98
10from lp.archiveuploader.utils import re_isadeb9from lp.archiveuploader.utils import re_isadeb
1110
diff --git a/lib/lp/soyuz/tests/test_archive.py b/lib/lp/soyuz/tests/test_archive.py
index cbc40ac..a02d75d 100644
--- a/lib/lp/soyuz/tests/test_archive.py
+++ b/lib/lp/soyuz/tests/test_archive.py
@@ -11,11 +11,11 @@ from datetime import (
11import doctest11import doctest
12import http.client12import http.client
13import os.path13import os.path
14from urllib.parse import urlsplit
1415
15from aptsources.sourceslist import SourceEntry16from aptsources.sourceslist import SourceEntry
16from pytz import UTC17from pytz import UTC
17import responses18import responses
18from six.moves.urllib.parse import urlsplit
19from storm.store import Store19from storm.store import Store
20from testtools.matchers import (20from testtools.matchers import (
21 AfterPreprocessing,21 AfterPreprocessing,
diff --git a/lib/lp/soyuz/tests/test_livefsbuild.py b/lib/lp/soyuz/tests/test_livefsbuild.py
index d448344..f642bcd 100644
--- a/lib/lp/soyuz/tests/test_livefsbuild.py
+++ b/lib/lp/soyuz/tests/test_livefsbuild.py
@@ -7,12 +7,12 @@ from datetime import (
7 datetime,7 datetime,
8 timedelta,8 timedelta,
9 )9 )
10from urllib.parse import urlsplit
11from urllib.request import urlopen
1012
11from fixtures import FakeLogger13from fixtures import FakeLogger
12from pymacaroons import Macaroon14from pymacaroons import Macaroon
13import pytz15import pytz
14from six.moves.urllib.parse import urlsplit
15from six.moves.urllib.request import urlopen
16from testtools.matchers import (16from testtools.matchers import (
17 ContainsDict,17 ContainsDict,
18 Equals,18 Equals,
diff --git a/lib/lp/soyuz/tests/test_packageupload.py b/lib/lp/soyuz/tests/test_packageupload.py
index 24d21ca..3e88b0e 100644
--- a/lib/lp/soyuz/tests/test_packageupload.py
+++ b/lib/lp/soyuz/tests/test_packageupload.py
@@ -7,13 +7,13 @@ from datetime import timedelta
7import io7import io
8import os.path8import os.path
9import shutil9import shutil
10from urllib.request import urlopen
1011
11from debian.deb822 import Changes12from debian.deb822 import Changes
12from lazr.restfulclient.errors import (13from lazr.restfulclient.errors import (
13 BadRequest,14 BadRequest,
14 Unauthorized,15 Unauthorized,
15 )16 )
16from six.moves.urllib.request import urlopen
17from testtools.matchers import (17from testtools.matchers import (
18 Equals,18 Equals,
19 MatchesListwise,19 MatchesListwise,
diff --git a/lib/lp/testing/keyserver/tests/test_harness.py b/lib/lp/testing/keyserver/tests/test_harness.py
index 18b5ac0..e0727f4 100644
--- a/lib/lp/testing/keyserver/tests/test_harness.py
+++ b/lib/lp/testing/keyserver/tests/test_harness.py
@@ -1,7 +1,7 @@
1# Copyright 2009-2011 Canonical Ltd. This software is licensed under the1# Copyright 2009-2011 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4from six.moves.urllib.request import urlopen4from urllib.request import urlopen
55
6from lp.services.config import config6from lp.services.config import config
7from lp.testing import TestCase7from lp.testing import TestCase
diff --git a/lib/lp/testing/layers.py b/lib/lp/testing/layers.py
index 94c5dcd..6af3146 100644
--- a/lib/lp/testing/layers.py
+++ b/lib/lp/testing/layers.py
@@ -65,6 +65,12 @@ from unittest import (
65 TestCase,65 TestCase,
66 TestResult,66 TestResult,
67 )67 )
68from urllib.error import (
69 HTTPError,
70 URLError,
71 )
72from urllib.parse import urlparse
73from urllib.request import urlopen
6874
69from fixtures import (75from fixtures import (
70 Fixture,76 Fixture,
@@ -73,12 +79,6 @@ from fixtures import (
73import psycopg279import psycopg2
74from requests import Session80from requests import Session
75from requests.adapters import HTTPAdapter81from requests.adapters import HTTPAdapter
76from six.moves.urllib.error import (
77 HTTPError,
78 URLError,
79 )
80from six.moves.urllib.parse import urlparse
81from six.moves.urllib.request import urlopen
82from storm.uri import URI82from storm.uri import URI
83from talisker.context import Context83from talisker.context import Context
84import transaction84import transaction
diff --git a/lib/lp/testing/pages.py b/lib/lp/testing/pages.py
index 0772e0c..c706ab8 100644
--- a/lib/lp/testing/pages.py
+++ b/lib/lp/testing/pages.py
@@ -11,6 +11,7 @@ from itertools import chain
11import os11import os
12import re12import re
13import unittest13import unittest
14from urllib.parse import urljoin
1415
15from bs4.element import (16from bs4.element import (
16 CData,17 CData,
@@ -25,7 +26,6 @@ from bs4.element import (
25from lazr.restful.testing.webservice import WebServiceCaller26from lazr.restful.testing.webservice import WebServiceCaller
26from oauthlib import oauth127from oauthlib import oauth1
27import six28import six
28from six.moves.urllib.parse import urljoin
29from soupsieve import escape as css_escape29from soupsieve import escape as css_escape
30import transaction30import transaction
31from webtest import TestRequest31from webtest import TestRequest
diff --git a/lib/lp/testing/publication.py b/lib/lp/testing/publication.py
index 74b350f..a0f6d55 100644
--- a/lib/lp/testing/publication.py
+++ b/lib/lp/testing/publication.py
@@ -10,11 +10,11 @@ __all__ = [
10 ]10 ]
1111
12import io12import io
1313from urllib.parse import (
14from six.moves.urllib_parse import (
15 unquote,14 unquote,
16 urljoin,15 urljoin,
17 )16 )
17
18from zope.app.publication.requestpublicationregistry import factoryRegistry18from zope.app.publication.requestpublicationregistry import factoryRegistry
19from zope.authentication.interfaces import IUnauthenticatedPrincipal19from zope.authentication.interfaces import IUnauthenticatedPrincipal
20from zope.component import (20from zope.component import (
diff --git a/lib/lp/testing/tests/test_layers_functional.py b/lib/lp/testing/tests/test_layers_functional.py
index 212701a..0a665dc 100644
--- a/lib/lp/testing/tests/test_layers_functional.py
+++ b/lib/lp/testing/tests/test_layers_functional.py
@@ -10,6 +10,8 @@ to confirm that the environment hasn't been corrupted by tests
10import io10import io
11import os11import os
12import signal12import signal
13from urllib.error import HTTPError
14from urllib.request import urlopen
1315
14import amqp16import amqp
15from fixtures import (17from fixtures import (
@@ -18,8 +20,6 @@ from fixtures import (
18 TestWithFixtures,20 TestWithFixtures,
19 )21 )
20import six22import six
21from six.moves.urllib.error import HTTPError
22from six.moves.urllib.request import urlopen
23from zope.component import getUtility23from zope.component import getUtility
24from zope.interface.interfaces import ComponentLookupError24from zope.interface.interfaces import ComponentLookupError
2525
diff --git a/lib/lp/testing/tests/test_publication.py b/lib/lp/testing/tests/test_publication.py
index 606ae31..a748c39 100644
--- a/lib/lp/testing/tests/test_publication.py
+++ b/lib/lp/testing/tests/test_publication.py
@@ -3,9 +3,10 @@
33
4"""Tests for the helpers in `lp.testing.publication`."""4"""Tests for the helpers in `lp.testing.publication`."""
55
6from urllib.parse import quote
7
6from lazr.restful import EntryResource8from lazr.restful import EntryResource
7from lazr.restful.utils import get_current_browser_request9from lazr.restful.utils import get_current_browser_request
8from six.moves.urllib_parse import quote
9from zope.browserpage.simpleviewclass import simple10from zope.browserpage.simpleviewclass import simple
10from zope.component import (11from zope.component import (
11 getSiteManager,12 getSiteManager,
diff --git a/lib/lp/testopenid/stories/basics.txt b/lib/lp/testopenid/stories/basics.txt
index 380bb7d..0543953 100644
--- a/lib/lp/testopenid/stories/basics.txt
+++ b/lib/lp/testopenid/stories/basics.txt
@@ -29,7 +29,7 @@ After determining the URL of the OpenID server, the next thing a consumer
29needs to do is associate with the server and get a shared secret via a29needs to do is associate with the server and get a shared secret via a
30POST request.30POST request.
3131
32 >>> from six.moves.urllib.parse import urlencode32 >>> from urllib.parse import urlencode
33 >>> anon_browser.open(33 >>> anon_browser.open(
34 ... 'http://testopenid.test/+openid', data=urlencode({34 ... 'http://testopenid.test/+openid', data=urlencode({
35 ... 'openid.mode': 'associate',35 ... 'openid.mode': 'associate',
diff --git a/lib/lp/testopenid/testing/helpers.py b/lib/lp/testopenid/testing/helpers.py
index 4d189e4..bcbe038 100644
--- a/lib/lp/testopenid/testing/helpers.py
+++ b/lib/lp/testopenid/testing/helpers.py
@@ -11,13 +11,13 @@ __all__ = [
11 ]11 ]
1212
13import io13import io
14from urllib.error import HTTPError
1415
15from openid import fetchers16from openid import fetchers
16from openid.consumer.discover import (17from openid.consumer.discover import (
17 OPENID_IDP_2_0_TYPE,18 OPENID_IDP_2_0_TYPE,
18 OpenIDServiceEndpoint,19 OpenIDServiceEndpoint,
19 )20 )
20from six.moves.urllib.error import HTTPError
21from zope.testbrowser.wsgi import Browser21from zope.testbrowser.wsgi import Browser
2222
23from lp.services.encoding import wsgi_native_string23from lp.services.encoding import wsgi_native_string
diff --git a/lib/lp/translations/browser/person.py b/lib/lp/translations/browser/person.py
index 2dd8d81..ec90dde 100644
--- a/lib/lp/translations/browser/person.py
+++ b/lib/lp/translations/browser/person.py
@@ -14,9 +14,9 @@ from datetime import (
14 timedelta,14 timedelta,
15 )15 )
16from itertools import islice16from itertools import islice
17from urllib.parse import urlencode
1718
18import pytz19import pytz
19from six.moves.urllib.parse import urlencode
20from zope.browserpage import ViewPageTemplateFile20from zope.browserpage import ViewPageTemplateFile
21from zope.component import getUtility21from zope.component import getUtility
22from zope.formlib.widget import CustomWidgetFactory22from zope.formlib.widget import CustomWidgetFactory
diff --git a/lib/lp/translations/browser/pofile.py b/lib/lp/translations/browser/pofile.py
index 1e85b3e..e636631 100644
--- a/lib/lp/translations/browser/pofile.py
+++ b/lib/lp/translations/browser/pofile.py
@@ -15,10 +15,10 @@ __all__ = [
1515
16import os.path16import os.path
17import re17import re
18from urllib.parse import urlencode
1819
19from lazr.restful.utils import smartquote20from lazr.restful.utils import smartquote
20import six21import six
21from six.moves.urllib.parse import urlencode
22from zope.component import getUtility22from zope.component import getUtility
23from zope.publisher.browser import FileUpload23from zope.publisher.browser import FileUpload
2424
diff --git a/lib/lp/translations/browser/tests/test_persontranslationview.py b/lib/lp/translations/browser/tests/test_persontranslationview.py
index e3c1251..aa0d873 100644
--- a/lib/lp/translations/browser/tests/test_persontranslationview.py
+++ b/lib/lp/translations/browser/tests/test_persontranslationview.py
@@ -1,7 +1,8 @@
1# Copyright 2009-2018 Canonical Ltd. This software is licensed under the1# Copyright 2009-2018 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4from six.moves.urllib.parse import urlencode4from urllib.parse import urlencode
5
5from zope.security.proxy import removeSecurityProxy6from zope.security.proxy import removeSecurityProxy
67
7from lp.app.enums import ServiceUsage8from lp.app.enums import ServiceUsage
diff --git a/lib/lp/translations/browser/translationmessage.py b/lib/lp/translations/browser/translationmessage.py
index 4f904d9..105ad46 100644
--- a/lib/lp/translations/browser/translationmessage.py
+++ b/lib/lp/translations/browser/translationmessage.py
@@ -19,12 +19,12 @@ __all__ = [
19import datetime19import datetime
20import operator20import operator
21import re21import re
2222from urllib.parse import (
23import pytz
24from six.moves.urllib.parse import (
25 parse_qsl,23 parse_qsl,
26 urlencode,24 urlencode,
27 )25 )
26
27import pytz
28from zope import datetime as zope_datetime28from zope import datetime as zope_datetime
29from zope.browserpage import ViewPageTemplateFile29from zope.browserpage import ViewPageTemplateFile
30from zope.component import getUtility30from zope.component import getUtility
diff --git a/lib/lp/translations/doc/poexport-request-productseries.txt b/lib/lp/translations/doc/poexport-request-productseries.txt
index a762411..45aa763 100644
--- a/lib/lp/translations/doc/poexport-request-productseries.txt
+++ b/lib/lp/translations/doc/poexport-request-productseries.txt
@@ -84,7 +84,7 @@ The email contains a URL linking to where the exported file can be downloaded.
8484
85Let's download it and make sure the contents look ok.85Let's download it and make sure the contents look ok.
8686
87 >>> from six.moves.urllib.request import urlopen87 >>> from urllib.request import urlopen
88 >>> from lp.services.helpers import bytes_to_tarfile88 >>> from lp.services.helpers import bytes_to_tarfile
89 >>> tarball = bytes_to_tarfile(urlopen(url).read())89 >>> tarball = bytes_to_tarfile(urlopen(url).read())
90 >>> for name in sorted(tarball.getnames()):90 >>> for name in sorted(tarball.getnames()):
diff --git a/lib/lp/translations/doc/poexport-request.txt b/lib/lp/translations/doc/poexport-request.txt
index 18d685d..5aee787 100644
--- a/lib/lp/translations/doc/poexport-request.txt
+++ b/lib/lp/translations/doc/poexport-request.txt
@@ -85,7 +85,7 @@ The email contains a URL linking to where the exported file can be downloaded.
8585
86Let's download it and make sure the contents look ok.86Let's download it and make sure the contents look ok.
8787
88 >>> from six.moves.urllib.request import urlopen88 >>> from urllib.request import urlopen
89 >>> from lp.services.helpers import bytes_to_tarfile89 >>> from lp.services.helpers import bytes_to_tarfile
90 >>> tarball = bytes_to_tarfile(urlopen(url).read())90 >>> tarball = bytes_to_tarfile(urlopen(url).read())
91 >>> for name in sorted(tarball.getnames()):91 >>> for name in sorted(tarball.getnames()):
diff --git a/lib/lp/translations/stories/importqueue/xx-translation-import-queue.txt b/lib/lp/translations/stories/importqueue/xx-translation-import-queue.txt
index 0dcbd93..2279d03 100644
--- a/lib/lp/translations/stories/importqueue/xx-translation-import-queue.txt
+++ b/lib/lp/translations/stories/importqueue/xx-translation-import-queue.txt
@@ -209,7 +209,7 @@ There is an option to remove entries from the queue.
209209
210No Privileges Person tries to remove entries but to no effect.210No Privileges Person tries to remove entries but to no effect.
211211
212 >>> from six.moves.urllib.parse import urlencode212 >>> from urllib.parse import urlencode
213 >>> post_data = urlencode(213 >>> post_data = urlencode(
214 ... {214 ... {
215 ... 'field.filter_target': 'all',215 ... 'field.filter_target': 'all',
diff --git a/utilities/paste b/utilities/paste
index 2787a3a..fa461f0 100755
--- a/utilities/paste
+++ b/utilities/paste
@@ -9,11 +9,11 @@ from optparse import OptionParser
9import os9import os
10import pwd10import pwd
11import sys11import sys
12from urllib.parse import urljoin
12import webbrowser13import webbrowser
1314
14from fixtures import MonkeyPatch15from fixtures import MonkeyPatch
15from six.moves.http_cookiejar import Cookie16from six.moves.http_cookiejar import Cookie
16from six.moves.urllib.parse import urljoin
17from zope.testbrowser.browser import Browser17from zope.testbrowser.browser import Browser
1818
1919
@@ -118,8 +118,7 @@ def main():
118 # Remove the check for robots.txt, since the one on118 # Remove the check for robots.txt, since the one on
119 # pastebin.ubuntu.com doesn't allow us to open the page. We're not119 # pastebin.ubuntu.com doesn't allow us to open the page. We're not
120 # really a robot.120 # really a robot.
121 with MonkeyPatch(121 with MonkeyPatch('urllib.robotparser.RobotFileParser.allow_all', True):
122 'six.moves.urllib.robotparser.RobotFileParser.allow_all', True):
123 browser.open(urljoin('https://' + paste_host, PASTE_PATH))122 browser.open(urljoin('https://' + paste_host, PASTE_PATH))
124123
125 if parser.options.private:124 if parser.options.private:
diff --git a/utilities/roundup-sniffer.py b/utilities/roundup-sniffer.py
index 5fbfb26..16bebbe 100755
--- a/utilities/roundup-sniffer.py
+++ b/utilities/roundup-sniffer.py
@@ -44,9 +44,8 @@ from os.path import (
44from pprint import pprint44from pprint import pprint
45import sys45import sys
46from time import sleep46from time import sleep
4747from urllib.parse import urlencode
48from six.moves.urllib.parse import urlencode48from urllib.request import urlopen
49from six.moves.urllib.request import urlopen
5049
51from lp.services.beautifulsoup import BeautifulSoup50from lp.services.beautifulsoup import BeautifulSoup
5251

Subscribers

People subscribed via source and target branches

to status/vote changes: