Ignore:
Timestamp:
07/23/17 13:06:08 (7 years ago)
Author:
obi
Message:

update python stuff

File:
1 edited

Legend:

Unmodified
Added
Removed
  • titan/mediathek/localhoster/lib/python2.7/xmlrpclib.py

    r40094 r40658  
    359359#
    360360# @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.
    362362
    363363def _strftime(value):
     
    394394            s = self.value
    395395            o = other.strftime("%Y%m%dT%H:%M:%S")
    396         elif isinstance(other, (str, unicode)):
     396        elif isinstance(other, basestring):
    397397            s = self.value
    398398            o = other
     
    704704    if unicode:
    705705        def dump_unicode(self, value, write, escape=escape):
    706             value = value.encode(self.encoding)
    707706            write("<value><string>")
    708             write(escape(value))
     707            write(escape(value).encode(self.encoding, 'xmlcharrefreplace'))
    709708            write("</string></value>\n")
    710709        dispatch[UnicodeType] = dump_unicode
     
    733732        for k, v in value.items():
    734733            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)
    741741            dump(v, write)
    742742            write("</member>\n")
     
    785785        self._marks = []
    786786        self._data = []
     787        self._value = False
    787788        self._methodname = None
    788789        self._encoding = "utf-8"
     
    815816            self._marks.append(len(self._stack))
    816817        self._data = []
     818        if self._value and tag not in self.dispatch:
     819            raise ResponseError("unknown tag %r" % tag)
    817820        self._value = (tag == "value")
    818821
     
    11001103        # a method call
    11011104        if not isinstance(methodname, StringType):
    1102             methodname = methodname.encode(encoding)
     1105            methodname = methodname.encode(encoding, 'xmlcharrefreplace')
    11031106        data = (
    11041107            xmlheader,
     
    15611564        # establish a "logical" server connection
    15621565
    1563         if isinstance(uri, unicode):
     1566        if unicode and isinstance(uri, unicode):
    15641567            uri = uri.encode('ISO-8859-1')
    15651568
     
    16171620        return _Method(self.__request, name)
    16181621
    1619     # note: to call a remote object with an non-standard name, use
     1622    # note: to call a remote object with a non-standard name, use
    16201623    # result getattr(server, "strange-python-name")(args)
    16211624
Note: See TracChangeset for help on using the changeset viewer.