import pickle


def restore_object(filename):
    """
    Read a `pickle` file and returns the saved objects.
    """
    try:
        with open(filename, 'rb') as bkp:
            reading = pickle.load(bkp)
    except (FileNotFoundError, PermissionError):
        message = 'There was a problem reading the pickle.\n'
        message += 'Please, check the path and permissions.'
        raise UserWarning(message)
    return reading