Message147572
Currently, an XMLRPC client communicating with a server running Python can make Python style calls but exceptions get collapsed into a standard FaultException making it difficult to program in a Pythonic style:
proxy = xmlrpc.client.ServerProxy("http://localhost:8000/")
try:
value = proxy.lookup('somekey')
except xmlrpc.client.Fault as err:
if err.faultCode == 1 and 'KeyError' in err.faultString:
k = re.search(r":.(\w+)' not found$", err.faultString).groups(1)
raise KeyError(k)
It would be better if we could do this automatically (search for a pure python exception of the same name and raise it instead of a Fault):
proxy = xmlrpc.client.ServerProxy("http://localhost:8000/", python_exceptions=True)
try:
value = proxy.lookup('somekey')
except KeyError as e:
... |
|
Date |
User |
Action |
Args |
2011-11-13 21:00:30 | rhettinger | set | recipients:
+ rhettinger |
2011-11-13 21:00:30 | rhettinger | set | messageid: <1321218030.66.0.0560016220773.issue13397@psf.upfronthosting.co.za> |
2011-11-13 21:00:28 | rhettinger | link | issue13397 messages |
2011-11-13 21:00:28 | rhettinger | create | |
|