xmlrpc_extended.client¶
Optional client helpers for XML-RPC callers.
XMLRPCClient¶
XMLRPCClient ¶
XMLRPCClient(uri: str, *, timeout: float = 30.0, allow_none: bool = False, use_builtin_types: bool = False)
Context-manager wrapper for :class:~xmlrpc.client.ServerProxy.
Ensures the underlying connection is closed on exit and enforces an explicit connection timeout so hung servers do not block callers indefinitely.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
uri
|
str
|
Full URL of the XML-RPC endpoint, e.g. |
required |
timeout
|
float
|
Socket timeout in seconds (default: 30.0). |
30.0
|
allow_none
|
bool
|
Whether |
False
|
use_builtin_types
|
bool
|
Use Python built-in types for XML-RPC date/binary. |
False
|
Example::
with XMLRPCClient("http://127.0.0.1:8000/", timeout=5.0) as proxy:
result = proxy.my_method(arg1, arg2)
.. note::
Retrying failed requests is the caller's responsibility. XML-RPC
methods are not necessarily idempotent, so automatic retries would
risk duplicate side-effects. Wrap the with block in your own
retry loop when retrying is safe.