Message88163
On the same documentation page for Python 3.1b1 it shows a similar error
for the ProtocolError example:
import xmlrpc.client
# create a ServerProxy with an invalid URI
proxy = xmlrpc.client.ServerProxy("http://invalidaddress/")
try:
proxy.some_method()
except xmlrpc.client.ProtocolError, err:
print("A protocol error occurred")
print("URL: %s" % err.url)
print("HTTP/HTTPS headers: %s" % err.headers)
print("Error code: %d" % err.errcode)
print("Error message: %s" % err.errmsg)
Throws this error:
File "proto.py", line 8
except xmlrpc.client.ProtocolError, err:
^
SyntaxError: invalid syntax
Which should be fixed with:
import xmlrpc.client
# create a ServerProxy with an invalid URI
proxy = xmlrpc.client.ServerProxy("http://invalidaddress/")
try:
proxy.some_method()
except xmlrpc.client.ProtocolError as err:
print("A protocol error occurred")
print("URL: %s" % err.url)
print("HTTP/HTTPS headers: %s" % err.headers)
print("Error code: %d" % err.errcode)
print("Error message: %s" % err.errmsg) |
|
Date |
User |
Action |
Args |
2009-05-21 17:20:23 | thijs | set | recipients:
+ thijs, georg.brandl |
2009-05-21 17:20:22 | thijs | set | messageid: <1242926422.81.0.303472244743.issue6079@psf.upfronthosting.co.za> |
2009-05-21 17:20:20 | thijs | link | issue6079 messages |
2009-05-21 17:20:19 | thijs | create | |
|