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 thijs
Recipients georg.brandl, thijs
Date 2009-05-21.16:11:57
SpamBayes Score 0.0052697714
Marked as misclassified No
Message-id <1242922319.61.0.524994134376.issue6079@psf.upfronthosting.co.za>
In-reply-to
Content
The example is defined as:

import xmlrpc.client

proxy = xmlrpc.client.ServerProxy("http://localhost:8000/")
try:
    proxy.add(2, 5)
except xmlrpc.client.Fault, err:
    print("A fault occurred")
    print("Fault code: %d" % err.faultCode)
    print("Fault string: %s" % err.faultString)

Which throws the following error:

  File "test.py", line 6
    except xmlrpc.client.Fault, err:
                              ^
SyntaxError: invalid syntax

I think it should be defined instead as:

import xmlrpc.client

proxy = xmlrpc.client.ServerProxy("http://localhost:8000/")
try:
    proxy.add(2, 5)
except xmlrpc.client.Fault as err:
    print("A fault occurred")
    print("Fault code: %d" % err.faultCode)
    print("Fault string: %s" % err.faultString)
History
Date User Action Args
2009-05-21 16:11:59thijssetrecipients: + thijs, georg.brandl
2009-05-21 16:11:59thijssetmessageid: <1242922319.61.0.524994134376.issue6079@psf.upfronthosting.co.za>
2009-05-21 16:11:58thijslinkissue6079 messages
2009-05-21 16:11:58thijscreate