summaryrefslogtreecommitdiffstats
path: root/Lib/xmlrpclib.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/xmlrpclib.py')
-rw-r--r--Lib/xmlrpclib.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/Lib/xmlrpclib.py b/Lib/xmlrpclib.py
index 2466e25..e7eb466 100644
--- a/Lib/xmlrpclib.py
+++ b/Lib/xmlrpclib.py
@@ -688,12 +688,15 @@ class Marshaller:
self.memo[i] = None
dump = self.__dump
write("<value><struct>\n")
- for k in value.keys():
+ for k, v in value.items():
write("<member>\n")
if type(k) is not StringType:
- raise TypeError, "dictionary key must be string"
+ if unicode and type(k) is UnicodeType:
+ k = k.encode(self.encoding)
+ else:
+ raise TypeError, "dictionary key must be string"
write("<name>%s</name>\n" % escape(k))
- dump(value[k], write)
+ dump(v, write)
write("</member>\n")
write("</struct></value>\n")
del self.memo[i]