[Python-checkins] python/dist/src/Lib xmlrpclib.py, 1.29.6.1, 1.29.6.2

akuchling at users.sourceforge.net akuchling at users.sourceforge.net
Sat Jun 5 08:55:35 EDT 2004


Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18774/Lib

Modified Files:
      Tag: release23-maint
	xmlrpclib.py 
Log Message:
[Bug #841757] Patch from /F to allow Unicode strings as struct keys
(Also a 2.2 bugfix candidate.)

Index: xmlrpclib.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/xmlrpclib.py,v
retrieving revision 1.29.6.1
retrieving revision 1.29.6.2
diff -C2 -d -r1.29.6.1 -r1.29.6.2
*** xmlrpclib.py	20 Oct 2003 14:34:46 -0000	1.29.6.1
--- xmlrpclib.py	5 Jun 2004 12:55:32 -0000	1.29.6.2
***************
*** 687,696 ****
          dump = self.__dump
          write("<value><struct>\n")
!         for k in value.keys():
              write("<member>\n")
              if type(k) is not StringType:
!                 raise TypeError, "dictionary key must be string"
              write("<name>%s</name>\n" % escape(k))
!             dump(value[k], write)
              write("</member>\n")
          write("</struct></value>\n")
--- 687,699 ----
          dump = self.__dump
          write("<value><struct>\n")
!         for k, v in value.items():
              write("<member>\n")
              if type(k) is not StringType:
!                 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(v, write)
              write("</member>\n")
          write("</struct></value>\n")




More information about the Python-checkins mailing list