mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
rpc: Don't use undocumented urllib functions
The "splittype" and "splithost" functions in urllib.parse are undocumented and reserved for internal use, see http://bugs.python.org/issue11009 Use urlsplit instead. Reviewed-By: David Kupka <dkupka@redhat.com> Reviewed-By: Jan Cholasta <jcholast@redhat.com> Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
committed by
Jan Cholasta
parent
f4e62be667
commit
c9ca8de7a2
@@ -1019,10 +1019,11 @@ class xmlclient(RPCClient):
|
||||
|
||||
class JSONServerProxy(object):
|
||||
def __init__(self, uri, transport, encoding, verbose, allow_none):
|
||||
type, uri = urllib.splittype(uri)
|
||||
if type not in ("http", "https"):
|
||||
split_uri = urllib.urlsplit(uri)
|
||||
if split_uri.scheme not in ("http", "https"):
|
||||
raise IOError("unsupported XML-RPC protocol")
|
||||
self.__host, self.__handler = urllib.splithost(uri)
|
||||
self.__host = split_uri.netloc
|
||||
self.__handler = split_uri.path
|
||||
self.__transport = transport
|
||||
|
||||
assert encoding == 'UTF-8'
|
||||
|
||||
Reference in New Issue
Block a user