mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Closes #13291: NameError in xmlrpc package.
This commit is contained in:
parent
2b50a01d11
commit
3fa29f7cd7
4 changed files with 56 additions and 13 deletions
|
@ -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"):
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue