Merge branch 'main' into avm99963-monorail
Merged commit cd4b3b336f1f14afa02990fdc2eec5d9467a827e
GitOrigin-RevId: e67bbf185d5538e1472bb42e0abb2a141f88bac1
diff --git a/framework/framework_helpers.py b/framework/framework_helpers.py
index b7199b1..47c34ef 100644
--- a/framework/framework_helpers.py
+++ b/framework/framework_helpers.py
@@ -17,8 +17,7 @@
import threading
import time
import traceback
-import urllib
-import urlparse
+from six.moves.urllib.parse import urlparse, quote, urlunparse
from google.appengine.api import app_identity
@@ -237,12 +236,12 @@
The url transposed into the given destination project.
"""
project_name = moved_to
- _, _, path, parameters, query, fragment_identifier = urlparse.urlparse(
+ _, _, path, parameters, query, fragment_identifier = urlparse(
mr.current_page_url)
# Strip off leading "/p/<moved from project>"
path = '/' + path.split('/', 3)[3]
- rest_of_url = urlparse.urlunparse(
- ('', '', path, parameters, query, fragment_identifier))
+ rest_of_url = urlunparse(
+ ('', '', path, parameters, query, fragment_identifier))
return '/p/%s%s' % (project_name, rest_of_url)
@@ -302,8 +301,9 @@
A URL with the specified query parameters.
"""
param_string = '&'.join(
- '%s=%s' % (name, urllib.quote(six.text_type(value).encode('utf-8')))
- for name, value in params if value is not None)
+ '%s=%s' % (name, quote(six.text_type(value).encode('utf-8')))
+ for name, value in params
+ if value is not None)
if not param_string:
qs_start_char = ''
elif '?' in url: