Skip to content

Commit ff51e3b

Browse files
committed
xmlrpc: Enable 'allow_none'
This is a custom extension to the XML-RPC spec so it's not enabled by default. In truth, the server shouldn't be returning `None` values but there's a bug somewhere. The server is frozen so we need to fix this here, on the client side. While we're here, 'Server' in the 'xmlrpc.client' library is a legacy alias for 'ServerProxy'. Update the call. Signed-off-by: Stephen Finucane <[email protected]> Closes: #22
1 parent 19b92bf commit ff51e3b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pwclient/api.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,11 @@ def __init__(self, server, *, username=None, password=None, token=None):
154154
transport.set_credentials(username, password)
155155

156156
try:
157-
rpc = xmlrpc.xmlrpclib.Server(self._server, transport=transport)
157+
rpc = xmlrpc.xmlrpclib.ServerProxy(
158+
self._server,
159+
transport=transport,
160+
allow_none=True,
161+
)
158162
except (IOError, OSError):
159163
raise exceptions.APIError(f'Unable to connect to {self._server}')
160164

0 commit comments

Comments
 (0)