diff options
author | Florent Xicluna <florent.xicluna@gmail.com> | 2011-10-30 19:18:50 (GMT) |
---|---|---|
committer | Florent Xicluna <florent.xicluna@gmail.com> | 2011-10-30 19:18:50 (GMT) |
commit | 3fa29f7cd77970df2d85db3e7565cf0ad2548883 (patch) | |
tree | 81ed4ad710f659a3383b362a5e426cafe71189da /Lib/xmlrpc | |
parent | 2b50a01d11710c0a01f90fa4398b717a63b1d0d8 (diff) | |
download | cpython-3fa29f7cd77970df2d85db3e7565cf0ad2548883.zip cpython-3fa29f7cd77970df2d85db3e7565cf0ad2548883.tar.gz cpython-3fa29f7cd77970df2d85db3e7565cf0ad2548883.tar.bz2 |
Closes #13291: NameError in xmlrpc package.
Diffstat (limited to 'Lib/xmlrpc')
-rw-r--r-- | Lib/xmlrpc/client.py | 2 | ||||
-rw-r--r-- | Lib/xmlrpc/server.py | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/Lib/xmlrpc/client.py b/Lib/xmlrpc/client.py index 19d4d69..9312344 100644 --- a/Lib/xmlrpc/client.py +++ b/Lib/xmlrpc/client.py @@ -302,7 +302,7 @@ class DateTime: elif datetime and isinstance(other, datetime.datetime): s = self.value o = other.strftime("%Y%m%dT%H:%M:%S") - elif isinstance(other, (str, unicode)): + elif isinstance(other, str): s = self.value o = other elif hasattr(other, "timetuple"): diff --git a/Lib/xmlrpc/server.py b/Lib/xmlrpc/server.py index ac252f1..9d93b1c7 100644 --- a/Lib/xmlrpc/server.py +++ b/Lib/xmlrpc/server.py @@ -602,7 +602,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 +620,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): |