def write(self, location=None):
        """
        Write file to I/O backend.
        """
        # Take location and expand tilde.
        if location is not None:
            self.location = location
        assert self.location

        # Find I/O backend that handles this location.
        for io in self.editor.io_backends:
            if io.can_open_location(self.location):
                break
        else:
            self.editor.show_message('Unknown location: %r' % location)

        # Write it.
        try:
            io.write(self.location, self.buffer.text + '\n', self.encoding)
            self.is_new = False
        except Exception as e:
            # E.g. "No such file or directory."
            self.editor.show_message(e % '%s')
        else:
            # When the save succeeds: update: _file_content.
            self._file_content = self.buffer.text
dataset/ETHPy150Open jonathanslenders/pyvim/pyvim/editor_buffer.py/EditorBuffer.write/swapped operands of `%`