Fix a remnant use of urllib from python2 in gajim-remote
This commit is contained in:
		
							parent
							
								
									67a43e7dea
								
							
						
					
					
						commit
						737b689c98
					
				
					 2 changed files with 4 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -35,7 +35,6 @@ import locale
 | 
			
		|||
import os
 | 
			
		||||
import subprocess
 | 
			
		||||
import urllib
 | 
			
		||||
from urllib.parse import urlparse
 | 
			
		||||
import webbrowser
 | 
			
		||||
import errno
 | 
			
		||||
import select
 | 
			
		||||
| 
						 | 
				
			
			@ -144,7 +143,7 @@ def puny_encode_url(url):
 | 
			
		|||
    _url = url
 | 
			
		||||
    if '//' not in _url:
 | 
			
		||||
        _url = '//' + _url
 | 
			
		||||
    o = urlparse(_url)
 | 
			
		||||
    o = urllib.parse.urlparse(_url)
 | 
			
		||||
    p_loc = idn_to_ascii(o.netloc)
 | 
			
		||||
    return url.replace(o.netloc, p_loc)
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -32,6 +32,7 @@ import urllib
 | 
			
		|||
import signal
 | 
			
		||||
signal.signal(signal.SIGINT, signal.SIG_DFL) # ^C exits the application
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
from common import exceptions
 | 
			
		||||
from common import i18n # This installs _() function
 | 
			
		||||
from common.i18n import Q_
 | 
			
		||||
| 
						 | 
				
			
			@ -543,7 +544,7 @@ class GajimRemote:
 | 
			
		|||
            return
 | 
			
		||||
        jid, args = uri.split('?', 1)
 | 
			
		||||
        try:
 | 
			
		||||
            jid = urllib.unquote(jid)
 | 
			
		||||
            jid = urllib.parse.unquote(jid)
 | 
			
		||||
        except UnicodeDecodeError:
 | 
			
		||||
            pass
 | 
			
		||||
        args = args.split(';')
 | 
			
		||||
| 
						 | 
				
			
			@ -565,7 +566,7 @@ class GajimRemote:
 | 
			
		|||
                # dialog
 | 
			
		||||
                message = options['body']
 | 
			
		||||
                try:
 | 
			
		||||
                    message = urllib.unquote(message)
 | 
			
		||||
                    message = urllib.parse.unquote(message)
 | 
			
		||||
                except UnicodeDecodeError:
 | 
			
		||||
                    pass
 | 
			
		||||
                if len(sys.argv) == 4:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue