--- /usr/lib/python2.3/xmlrpclib.py 2004-09-24 08:57:54.000000000 +0200 +++ ./xmlrpclib2.py 2004-11-20 15:50:16.000000000 +0100 @@ -611,7 +611,19 @@ class Marshaller: try: f = self.dispatch[type(value)] except KeyError: - raise TypeError, "cannot marshal %s objects" % type(value) + # check if this object can be marshalled as a structure + try: + value.__dict__ + except: + raise TypeError, "cannot marshal %s objects" % type(value) + # check if this class is a sub-class of a basic type, + # because we don't know how to marshal these types + # (e.g. a string sub-class) + for type_ in type(value).__mro__: + if type_ in self.dispatch.keys(): + raise TypeError, "cannot marshal %s objects" % type(value) + f = self.dispatch[InstanceType] + f(self, value, write) else: f(self, value, write) @@ -710,7 +722,7 @@ class Marshaller: # store instance attributes as a struct (really?) self.dump_struct(value.__dict__, write) dispatch[InstanceType] = dump_instance - + ## # XML-RPC unmarshaller. #