a1 = hashlib.md5('%s:%s:%s' % (self.username, self.domain, self.password)
    ).digest()
a1 = '%s:%s:%s' % (a1.decode('ISO-8859-1'), challenge['nonce'], cnonce)
Python: concatenating bytes with a string