def METHOD_NAME(self, s):
    if isinstance(s, bytes):
        # Just allow this case to work
        s = s.decode("latin-1")
    elif self.encoding is not None:
        s.encode(self.encoding)
    return super().METHOD_NAME(s)