summaryrefslogtreecommitdiffstats
path: root/Lib/xmlrpc
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2021-03-29 13:39:31 (GMT)
committerGitHub <noreply@github.com>2021-03-29 13:39:31 (GMT)
commitc1b073a630bb731de18bb17afb2b8b1388b92a72 (patch)
tree9be9c9c8f9e8d2b893ddc976c34015bf54d87ace /Lib/xmlrpc
parent70cdf1812cf479c6b1cd7435a6fc0679ec1fb0da (diff)
downloadcpython-c1b073a630bb731de18bb17afb2b8b1388b92a72.zip
cpython-c1b073a630bb731de18bb17afb2b8b1388b92a72.tar.gz
cpython-c1b073a630bb731de18bb17afb2b8b1388b92a72.tar.bz2
bpo-43433: Preserve query and fragment in the URL of the server in ServerProxy. (GH-25057)
Diffstat (limited to 'Lib/xmlrpc')
-rw-r--r--Lib/xmlrpc/client.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/xmlrpc/client.py b/Lib/xmlrpc/client.py
index d15d60d..9e7449c 100644
--- a/Lib/xmlrpc/client.py
+++ b/Lib/xmlrpc/client.py
@@ -1421,11 +1421,13 @@ class ServerProxy:
# establish a "logical" server connection
# get the url
- p = urllib.parse.urlparse(uri)
+ p = urllib.parse.urlsplit(uri)
if p.scheme not in ("http", "https"):
raise OSError("unsupported XML-RPC protocol")
self.__host = p.netloc
- self.__handler = p.path or "/RPC2"
+ self.__handler = urllib.parse.urlunsplit(["", "", *p[2:]])
+ if not self.__handler:
+ self.__handler = "/RPC2"
if transport is None:
if p.scheme == "https":