import tempfile


def make_temp_file_copy(source_path):
    """Make a temporary file that is a copy of the source file."""
    temp_file = tempfile.NamedTemporaryFile(delete=False)
    with open(source_path, "r+b") as src_file:
        temp_file.writelines(src_file.readlines())
    temp_file.close()  # close the file handler so we can reopen later
    return temp_file.name