<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_new_version(new_version: str) -> bool: """ Replaces the version number in the correct place and writes the changed file to disk. :param new_version: The new version number as a string. :return: `True` if it succeeded. """

    filename, variable = config.get(
        'semantic_release', 'version_variable').split(':')
    variable = variable.strip()
    with open(filename, mode='r') as fr:
        content = fr.read()

    content = replace_version_string(content, variable, new_version)

    with open(filename, mode='w') as fw:
        fw.write(content)
    return True