Author schwarz
Recipients schwarz
Date 2008-02-11.19:08:28
SpamBayes Score 0.0654352
Marked as misclassified No
Message-id <1202756969.25.0.603492596378.issue2072@psf.upfronthosting.co.za>
In-reply-to
Content
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
the documentation.
History
Date User Action Args
2008-02-11 19:09:29schwarzsetspambayes_score: 0.0654352 -> 0.0654352
recipients: + schwarz
2008-02-11 19:09:29schwarzsetspambayes_score: 0.0654352 -> 0.0654352
messageid: <1202756969.25.0.603492596378.issue2072@psf.upfronthosting.co.za>
2008-02-11 19:08:29schwarzlinkissue2072 messages
2008-02-11 19:08:28schwarzcreate