Fix a remnant use of urllib from python2 in gajim-remote

This commit is contained in:
Emmanuel Gil Peyrot 2016-01-24 19:12:30 +00:00
parent 67a43e7dea
commit 737b689c98
2 changed files with 4 additions and 4 deletions

View File

@ -35,7 +35,6 @@ import locale
import os import os
import subprocess import subprocess
import urllib import urllib
from urllib.parse import urlparse
import webbrowser import webbrowser
import errno import errno
import select import select
@ -144,7 +143,7 @@ def puny_encode_url(url):
_url = url _url = url
if '//' not in _url: if '//' not in _url:
_url = '//' + _url _url = '//' + _url
o = urlparse(_url) o = urllib.parse.urlparse(_url)
p_loc = idn_to_ascii(o.netloc) p_loc = idn_to_ascii(o.netloc)
return url.replace(o.netloc, p_loc) return url.replace(o.netloc, p_loc)

View File

@ -32,6 +32,7 @@ import urllib
import signal import signal
signal.signal(signal.SIGINT, signal.SIG_DFL) # ^C exits the application signal.signal(signal.SIGINT, signal.SIG_DFL) # ^C exits the application
from common import exceptions from common import exceptions
from common import i18n # This installs _() function from common import i18n # This installs _() function
from common.i18n import Q_ from common.i18n import Q_
@ -543,7 +544,7 @@ class GajimRemote:
return return
jid, args = uri.split('?', 1) jid, args = uri.split('?', 1)
try: try:
jid = urllib.unquote(jid) jid = urllib.parse.unquote(jid)
except UnicodeDecodeError: except UnicodeDecodeError:
pass pass
args = args.split(';') args = args.split(';')
@ -565,7 +566,7 @@ class GajimRemote:
# dialog # dialog
message = options['body'] message = options['body']
try: try:
message = urllib.unquote(message) message = urllib.parse.unquote(message)
except UnicodeDecodeError: except UnicodeDecodeError:
pass pass
if len(sys.argv) == 4: if len(sys.argv) == 4: