New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SyntaxError in xmlrpc.client examples #50329
Comments
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 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) |
On the same documentation page for Python 3.1b1 it shows a similar error import xmlrpc.client
# create a ServerProxy with an invalid URI
proxy = xmlrpc.client.ServerProxy("http://invalidaddress/") try: Throws this error: File "proto.py", line 8 Which should be fixed with: import xmlrpc.client
# create a ServerProxy with an invalid URI
proxy = xmlrpc.client.ServerProxy("http://invalidaddress/") try: |
Updated ticket title since it's for multiple sections in the |
Thanks, fixed in r72832. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: