This one should be:

self.log.debug('No session cached for "%s"' % to_bytes(self.username))