diff -r 5c09e1c57200 Lib/xmlrpc/client.py --- a/Lib/xmlrpc/client.py Wed Mar 20 20:16:47 2013 +0100 +++ b/Lib/xmlrpc/client.py Wed Mar 20 18:27:44 2013 -0700 @@ -682,9 +682,16 @@ try: f = self.dispatch[tag] except KeyError: - pass # unknown tag ? + pass # unknown tag ? else: - return f(self, "".join(self._data)) + # Avoid a data copy if only one item + if len(self._data) != 1: + data = ''.join(self._data) + else: + data = self._data[0] + # Free _data as soon as we can, to avoid keeping memory too long + self._data = [] + return f(self, data) # # accelerator support