[Python-checkins] bpo-38038: Remove urllib.parse._splittype from xmlrpc.client. (GH-15703)
Serhiy Storchaka
webhook-mailer at python.org
Sun Sep 8 04:54:19 EDT 2019
https://github.com/python/cpython/commit/9c4c459ac66c86a4511c8fec1997e8760e15ec17
commit: 9c4c459ac66c86a4511c8fec1997e8760e15ec17
branch: master
author: Dong-hee Na <donghee.na92 at gmail.com>
committer: Serhiy Storchaka <storchaka at gmail.com>
date: 2019-09-08T11:54:02+03:00
summary:
bpo-38038: Remove urllib.parse._splittype from xmlrpc.client. (GH-15703)
files:
M Lib/xmlrpc/client.py
diff --git a/Lib/xmlrpc/client.py b/Lib/xmlrpc/client.py
index b4b2941ea5b4..d15d60d2937a 100644
--- a/Lib/xmlrpc/client.py
+++ b/Lib/xmlrpc/client.py
@@ -1421,15 +1421,14 @@ def __init__(self, uri, transport=None, encoding=None, verbose=False,
# establish a "logical" server connection
# get the url
- type, uri = urllib.parse._splittype(uri)
- if type not in ("http", "https"):
+ p = urllib.parse.urlparse(uri)
+ if p.scheme not in ("http", "https"):
raise OSError("unsupported XML-RPC protocol")
- self.__host, self.__handler = urllib.parse._splithost(uri)
- if not self.__handler:
- self.__handler = "/RPC2"
+ self.__host = p.netloc
+ self.__handler = p.path or "/RPC2"
if transport is None:
- if type == "https":
+ if p.scheme == "https":
handler = SafeTransport
extra_kwargs = {"context": context}
else:
More information about the Python-checkins
mailing list