def get_state(self) -> str:
        """Get pickled state for restarting qtile"""
        buf = io.BytesIO()
        self.dump_state(buf)
        state = buf.getvalue().decode(errors="backslashreplace")
        logger.debug("State = %s", state)
        return state
Get pickled state for restarting qtile
libqtile/core/manager.py