New submission from Thijs Triemstra <li...@collab.nl>:

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)

----------
assignee: georg.brandl
components: Documentation
messages: 88162
nosy: georg.brandl, thijs
severity: normal
status: open
title: SyntaxError in xmlrpc.client Fault example
type: compile error
versions: Python 3.0

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue6079>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to