def METHOD_NAME(self, data: T) -> T:
    text = not isinstance(data, bytes)
    fd, name = tempfile.mkstemp("", "mitmproxy", text=text)
    with open(fd, "w" if text else "wb") as f:
        f.write(data)
    c = self.get_editor()
    cmd = shlex.split(c)
    cmd.append(name)
    with self.uistopped():
        try:
            subprocess.call(cmd)
        except Exception:
            signals.status_message.send(message="Can't start editor: %s" % c)
        else:
            with open(name, "r" if text else "rb") as f:
                data = f.read()
    os.unlink(name)
    return data