Changeset 40658 for titan/mediathek/localhoster/lib/python2.7/xmlrpclib.py
- Timestamp:
- 07/23/17 13:06:08 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
titan/mediathek/localhoster/lib/python2.7/xmlrpclib.py
r40094 r40658 359 359 # 360 360 # @param value The time, given as an ISO 8601 string, a time 361 # tuple, or a integer time value.361 # tuple, or an integer time value. 362 362 363 363 def _strftime(value): … … 394 394 s = self.value 395 395 o = other.strftime("%Y%m%dT%H:%M:%S") 396 elif isinstance(other, (str, unicode)):396 elif isinstance(other, basestring): 397 397 s = self.value 398 398 o = other … … 704 704 if unicode: 705 705 def dump_unicode(self, value, write, escape=escape): 706 value = value.encode(self.encoding)707 706 write("<value><string>") 708 write(escape(value) )707 write(escape(value).encode(self.encoding, 'xmlcharrefreplace')) 709 708 write("</string></value>\n") 710 709 dispatch[UnicodeType] = dump_unicode … … 733 732 for k, v in value.items(): 734 733 write("<member>\n") 735 if type(k) is not StringType: 736 if unicode and type(k) is UnicodeType: 737 k = k.encode(self.encoding) 738 else: 739 raise TypeError, "dictionary key must be string" 740 write("<name>%s</name>\n" % escape(k)) 734 if type(k) is StringType: 735 k = escape(k) 736 elif unicode and type(k) is UnicodeType: 737 k = escape(k).encode(self.encoding, 'xmlcharrefreplace') 738 else: 739 raise TypeError, "dictionary key must be string" 740 write("<name>%s</name>\n" % k) 741 741 dump(v, write) 742 742 write("</member>\n") … … 785 785 self._marks = [] 786 786 self._data = [] 787 self._value = False 787 788 self._methodname = None 788 789 self._encoding = "utf-8" … … 815 816 self._marks.append(len(self._stack)) 816 817 self._data = [] 818 if self._value and tag not in self.dispatch: 819 raise ResponseError("unknown tag %r" % tag) 817 820 self._value = (tag == "value") 818 821 … … 1100 1103 # a method call 1101 1104 if not isinstance(methodname, StringType): 1102 methodname = methodname.encode(encoding )1105 methodname = methodname.encode(encoding, 'xmlcharrefreplace') 1103 1106 data = ( 1104 1107 xmlheader, … … 1561 1564 # establish a "logical" server connection 1562 1565 1563 if isinstance(uri, unicode):1566 if unicode and isinstance(uri, unicode): 1564 1567 uri = uri.encode('ISO-8859-1') 1565 1568 … … 1617 1620 return _Method(self.__request, name) 1618 1621 1619 # note: to call a remote object with a nnon-standard name, use1622 # note: to call a remote object with a non-standard name, use 1620 1623 # result getattr(server, "strange-python-name")(args) 1621 1624
Note: See TracChangeset
for help on using the changeset viewer.