This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients rhettinger
Date 2011-11-13.21:00:28
SpamBayes Score 0.00999546
Marked as misclassified No
Message-id <1321218030.66.0.0560016220773.issue13397@psf.upfronthosting.co.za>
In-reply-to
Content
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:
   ...
History
Date User Action Args
2011-11-13 21:00:30rhettingersetrecipients: + rhettinger
2011-11-13 21:00:30rhettingersetmessageid: <1321218030.66.0.0560016220773.issue13397@psf.upfronthosting.co.za>
2011-11-13 21:00:28rhettingerlinkissue13397 messages
2011-11-13 21:00:28rhettingercreate