'Get the reason as a string.'

def _reasonstr(self):

    if isinstance(self.reason, six.text_type):
        return self.reason
    elif isinstance(self.reason, bytes):
        return self.reason.decode('utf-8', 'ignore')
    elif hasattr(self.reason, 'strerror'):
        return self.reason.strerror
    else:
        return u'"{0}"'.format(six.text_type(self.reason))
