(self, prop)
return (key, val)
>>> parse_property(b'key=value')
        ('key', 'value')
        >>> parse_property(b'foo')
        ('foo', '')
        >>> parse_property(b'client_unique_identifier=gZ7K[...]GIik=')
        ('client_unique_identifier', 'gZ7K[...]GIik=')
>>> parse_property(b'key=value')
        ('key', 'value')
        >>> parse_property(b'foo')
        ('foo', '')
        >>> parse_property(b'client_unique_identifier=gZ7K[...]GIik=')
        ('client_unique_identifier', 'gZ7K[...]GIik=')
>>> parse_property ( b key = value ) ( key value ) >>> parse_property ( b foo ) ( foo ) >>> parse_property ( b client_unique_identifier = gZ7K [ ... ] GIik = ) ( client_unique_identifier gZ7K [ ... ] GIik = )
def _parse_property(self, prop):
        """
        >>> parse_property(b'key=value')
        ('key', 'value')
        >>> parse_property(b'foo')
        ('foo', '')
        >>> parse_property(b'client_unique_identifier=gZ7K[...]GIik=')
        ('client_unique_identifier', 'gZ7K[...]GIik=')
        """
        prop = prop.split(b"=")
        if len(prop) == 1:
            key = prop[0]
            val = bytes()
        elif len(prop) == 2:
            key, val = prop
        else:
            key = prop[0]
            val = b"=".join(prop[1:])

        # Take a look at https://github.com/benediktschmitt/py-ts3/issues/34
        # to find out, why we simply ignore the decode errors.
        try:
            key = key.decode()
        except UnicodeDecodeError as err:
            LOG.warning("Failed to decode the key part properly: '%s'.", err)
            key = key.decode(errors="ignore")

        try:
            val = val.decode()
        except UnicodeDecodeError as err:
            LOG.warning("Failed to decode the value part properly: '%s'.", err)
            val = val.decode(errors="ignore")

        key = TS3Escape.unescape(key)
        val = TS3Escape.unescape(val)
        return (key, val)
def _parse_property ( self , prop ) : prop = prop . split ( b"=" ) if len ( prop ) == 1 : key = prop [ 0 ] val = bytes ( ) elif len ( prop ) == 2 : key , val = prop else : key = prop [ 0 ] val = b"=" . join ( prop [ 1 : ] ) # Take a look at https://github.com/benediktschmitt/py-ts3/issues/34 # to find out, why we simply ignore the decode errors. try : key = key . decode ( ) except UnicodeDecodeError as err : LOG . warning ( "Failed to decode the key part properly: '%s'." , err ) key = key . decode ( errors = "ignore" ) try : val = val . decode ( ) except UnicodeDecodeError as err : LOG . warning ( "Failed to decode the value part properly: '%s'." , err ) val = val . decode ( errors = "ignore" ) key = TS3Escape . unescape ( key ) val = TS3Escape . unescape ( val ) return ( key , val )