This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: SimpleXMLRPCServer documentation about rpc_paths might be wrong
Type: behavior Stage:
Components: Documentation Versions: Python 2.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: akuchling Nosy List: akuchling, schwarz
Priority: normal Keywords:

Created on 2008-02-11 19:08 by schwarz, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
SimpleXMLRPCServerTEST.tgz schwarz, 2008-02-11 19:08 Sample code from the documentation modified 2 lines
Messages (2)
msg62291 - (view) Author: Stefan Schwarzburg (schwarz) Date: 2008-02-11 19:08
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.
msg62753 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2008-02-23 15:42
Thanks for pointing out this error.  Corrected in rev. 60987.
History
Date User Action Args
2022-04-11 14:56:30adminsetgithub: 46344
2008-02-23 15:42:29akuchlingsetstatus: open -> closed
resolution: fixed
messages: + msg62753
2008-02-15 17:30:54akuchlingsetassignee: akuchling
nosy: + akuchling
2008-02-11 19:08:29schwarzcreate