[New-bugs-announce] [issue2072] SimpleXMLRPCServer documentation about rpc_paths might be wrong
report at bugs.python.org
Mon Feb 11 20:09:29 CET 2008
New submission from Stefan Schwarzburg:
In the documentation for SimpleXMLRPCServer
(http://docs.python.org/lib/simple-xmlrpc-servers.html)it is said, that
the SimpleXMLRPCServer object has an attribute "rpc_paths" that could be
set to valid path portions.
This would mean that changing the example code on the same page by
adding a line like:
server = SimpleXMLRPCServer(("localhost", 8000))
server.rpc_paths = ('/test')
would result in a call to 'http://localhost:8000/test' be processed
correctly. But this is not the case.
The server object has no attribute 'rpc_paths' nor does creating an
attribute like this change anything.
What however works is a line like this:
server.RequestHandlerClass.rpc_paths = ('/test')
The reason for this is that the test 'is_rpc_path_valid' is a method of
the class SimpleXMLRPCRequestHandler which tests if the path is in the
class attribute 'rpc_paths' of SimpleXMLRPCRequestHandler. This class is
saved as RequestHandlerClass in SimpleXMLRPCServer.
So the behavior of the code is understandable but is not described by
title: SimpleXMLRPCServer documentation about rpc_paths might be wrong
versions: Python 2.5
Added file: http://bugs.python.org/file9412/SimpleXMLRPCServerTEST.tgz
Tracker <report at bugs.python.org>
More information about the New-bugs-announce