From 0eb423ab18b3aa277fdffffbd38f8466023824ca Mon Sep 17 00:00:00 2001 From: Julien Castiaux Date: Mon, 1 Mar 2021 12:11:54 +0100 Subject: [PATCH] bpo-43330: pass uri query parameters along xmlrpc requests When using the `xmlrpc.client.ProxyServer` object to access via rpc a remote server, the params and query segments of the uri were discarded. The xml-rpc specification does not say anything about those two segments and py2's xmlrpclib was sending them already. --- Lib/xmlrpc/client.py | 4 ++++ .../next/Library/2021-03-01-12-09-25.bpo-43330.wXIGlD.rst | 1 + 2 files changed, 5 insertions(+) create mode 100644 Misc/NEWS.d/next/Library/2021-03-01-12-09-25.bpo-43330.wXIGlD.rst diff --git a/Lib/xmlrpc/client.py b/Lib/xmlrpc/client.py index d15d60d2937a825..9d46aea7aeb6e94 100644 --- a/Lib/xmlrpc/client.py +++ b/Lib/xmlrpc/client.py @@ -1426,6 +1426,10 @@ def __init__(self, uri, transport=None, encoding=None, verbose=False, raise OSError("unsupported XML-RPC protocol") self.__host = p.netloc self.__handler = p.path or "/RPC2" + if p.params: + self.__handler += f';{p.params}' + if p.query: + self.__handler += f'?{p.query}' if transport is None: if p.scheme == "https": diff --git a/Misc/NEWS.d/next/Library/2021-03-01-12-09-25.bpo-43330.wXIGlD.rst b/Misc/NEWS.d/next/Library/2021-03-01-12-09-25.bpo-43330.wXIGlD.rst new file mode 100644 index 000000000000000..1cd2202e8bc777d --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-03-01-12-09-25.bpo-43330.wXIGlD.rst @@ -0,0 +1 @@ +Pass uri query parametters along xmlrpc requests