code: def PrepareMergeTaskStorage(self, task):
      
      if self._storage_type != definitions.STORAGE_TYPE_SESSION:
        raise IOError('Unsupported storage type.')
  
      merge_storage_file_path = self._GetMergeTaskStorageFilePath(task)
      processed_storage_file_path = self._GetProcessedStorageFilePath(task)
  
      task.storage_file_size = os.path.getsize(processed_storage_file_path)
  
      try:
        os.rename(processed_storage_file_path, merge_storage_file_path)
      except OSError as exception:
        raise IOError((
            'Unable to rename task storage file: {0:s} with error: '
            '{1!s}').format(processed_storage_file_path, exception))
docs: Prepares a task storage for merging.
  
      Moves the task storage file from the processed directory to the merge
      directory.
  
      Args:
        task (Task): task.
  
      Raises:
        IOError: if the storage type is not supported or
            if the storage file cannot be renamed.
        OSError: if the storage type is not supported or
            if the storage file cannot be renamed.