summaryrefslogtreecommitdiffstats
path: root/Lib/xmlrpc/server.py
diff options
context:
space:
mode:
authorFlorent Xicluna <florent.xicluna@gmail.com>2011-10-30 19:26:28 (GMT)
committerFlorent Xicluna <florent.xicluna@gmail.com>2011-10-30 19:26:28 (GMT)
commit9783b44bcf0f539b56165d823d2b6eede080c1d8 (patch)
treecce085988b5f8a3ccc62fb4541a3180a399d8e85 /Lib/xmlrpc/server.py
parentcd06a14df7195404d04442598c802d6c096bb15d (diff)
parent93dfee1dfc0bf572d4d9579fd455a72c0c81f148 (diff)
downloadcpython-9783b44bcf0f539b56165d823d2b6eede080c1d8.zip
cpython-9783b44bcf0f539b56165d823d2b6eede080c1d8.tar.gz
cpython-9783b44bcf0f539b56165d823d2b6eede080c1d8.tar.bz2
Merge heads
Diffstat (limited to 'Lib/xmlrpc/server.py')
-rw-r--r--Lib/xmlrpc/server.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/xmlrpc/server.py b/Lib/xmlrpc/server.py
index ac252f1..72f3bfc 100644
--- a/Lib/xmlrpc/server.py
+++ b/Lib/xmlrpc/server.py
@@ -329,7 +329,6 @@ class SimpleXMLRPCDispatcher:
if method is None:
return ""
else:
- import pydoc
return pydoc.getdoc(method)
def system_multicall(self, call_list):
@@ -560,7 +559,7 @@ class SimpleXMLRPCServer(socketserver.TCPServer,
Simple XML-RPC server that allows functions and a single instance
to be installed to handle requests. The default implementation
attempts to dispatch XML-RPC calls to the functions or instance
- installed in the server. Override the _dispatch method inhereted
+ installed in the server. Override the _dispatch method inherited
from SimpleXMLRPCDispatcher to change this behavior.
"""
@@ -602,7 +601,7 @@ class MultiPathXMLRPCServer(SimpleXMLRPCServer):
encoding, bind_and_activate)
self.dispatchers = {}
self.allow_none = allow_none
- self.encoding = encoding
+ self.encoding = encoding or 'utf-8'
def add_dispatcher(self, path, dispatcher):
self.dispatchers[path] = dispatcher
@@ -620,9 +619,10 @@ class MultiPathXMLRPCServer(SimpleXMLRPCServer):
# (each dispatcher should have handled their own
# exceptions)
exc_type, exc_value = sys.exc_info()[:2]
- response = xmlrpclib.dumps(
- xmlrpclib.Fault(1, "%s:%s" % (exc_type, exc_value)),
+ response = dumps(
+ Fault(1, "%s:%s" % (exc_type, exc_value)),
encoding=self.encoding, allow_none=self.allow_none)
+ response = response.encode(self.encoding)
return response
class CGIXMLRPCRequestHandler(SimpleXMLRPCDispatcher):