mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 16:37:23 +00:00
Switch all urllib/urlparse usage to six.moves.urllib.
This provides Python 2+3 compatibility for our use of urllib. Also add a test to avoid future regressions.
This commit is contained in:
@@ -13,7 +13,7 @@ import datetime
|
||||
import re
|
||||
import subprocess
|
||||
import ujson
|
||||
import urllib
|
||||
from six.moves import urllib
|
||||
from collections import defaultdict
|
||||
|
||||
def unsubscribe_token(user_profile):
|
||||
@@ -35,7 +35,7 @@ def hashchange_encode(string):
|
||||
# Do the same encoding operation as hashchange.encodeHashComponent on the
|
||||
# frontend.
|
||||
# `safe` has a default value of "/", but we want those encoded, too.
|
||||
return urllib.quote(
|
||||
return urllib.parse.quote(
|
||||
string.encode("utf-8"), safe="").replace(".", "%2E").replace("%", ".")
|
||||
|
||||
def pm_narrow_url(participants):
|
||||
|
||||
Reference in New Issue
Block a user