def file_to_str(fname):
    """
    Reads and returns the contents of the given file.

    @param fname: The location of the file to read.
    @return: The contents of the given file.
    :raises: IOError if the file can't be opened for reading.
    """
    with open(fname) as f:
        return f.read()
