Renames this path to the given new location.

        :param new: New path where to move this one.

        :param parents: If set to True, it will create the parent directories
            of the target if they don't exist.

def rename(self, new, parents=False):
        """Renames this path to the given new location.

        :param new: New path where to move this one.

        :param parents: If set to True, it will create the parent directories
            of the target if they don't exist.
        """
        if parents:
            os.renames(self.path, self._to_backend(new))
        else:
            os.rename(self.path, self._to_backend(new))