Skip to content

Commit

Permalink
xmlrpc: Enable 'allow_none'
Browse files Browse the repository at this point in the history
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
  • Loading branch information
stephenfin committed May 2, 2023
1 parent 19b92bf commit ff51e3b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pwclient/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,11 @@ def __init__(self, server, *, username=None, password=None, token=None):
transport.set_credentials(username, password)

try:
rpc = xmlrpc.xmlrpclib.Server(self._server, transport=transport)
rpc = xmlrpc.xmlrpclib.ServerProxy(
self._server,
transport=transport,
allow_none=True,
)
except (IOError, OSError):
raise exceptions.APIError(f'Unable to connect to {self._server}')

Expand Down

0 comments on commit ff51e3b

Please sign in to comment.