def get_config_tuple_from_egrc(egrc_path):
    """
    Create a Config named tuple from the values specified in the .egrc. Expands
    any paths as necessary.

    egrc_path must exist and point a file.

    If not present in the .egrc, properties of the Config are returned as None.
    """
    with open(egrc_path, 'r') as egrc:
        try:
            config = ConfigParser.RawConfigParser()
        except AttributeError:
            config = ConfigParser()
        # Support Python 3.12 and above.
        try:
            config.readfp(egrc)
        except AttributeError:
            config.read_file(egrc)

        # default to None
        examples_dir = None
        custom_dir = None
        use_color = None
        pager_cmd = None
        squeeze = None
        subs = None
        editor_cmd = None

        if config.has_option(DEFAULT_SECTION, EG_EXAMPLES_DIR):
            examples_dir = config.get(DEFAULT_SECTION, EG_EXAMPLES_DIR)
            examples_dir = get_expanded_path(examples_dir)

        if config.has_option(DEFAULT_SECTION, CUSTOM_EXAMPLES_DIR):
            custom_dir = config.get(DEFAULT_SECTION, CUSTOM_EXAMPLES_DIR)
            custom_dir = get_expanded_path(custom_dir)

        if config.has_option(DEFAULT_SECTION, USE_COLOR):
            use_color_raw = config.get(DEFAULT_SECTION, USE_COLOR)
            use_color = _parse_bool_from_raw_egrc_value(use_color_raw)

        if config.has_option(DEFAULT_SECTION, PAGER_CMD):
            pager_cmd_raw = config.get(DEFAULT_SECTION, PAGER_CMD)
            pager_cmd = ast.literal_eval(pager_cmd_raw)

        if config.has_option(DEFAULT_SECTION, EDITOR_CMD):
            editor_cmd_raw = config.get(DEFAULT_SECTION, EDITOR_CMD)
            editor_cmd = ast.literal_eval(editor_cmd_raw)

        color_config = get_custom_color_config_from_egrc(config)

        if config.has_option(DEFAULT_SECTION, SQUEEZE):
            squeeze_raw = config.get(DEFAULT_SECTION, SQUEEZE)
            squeeze = _parse_bool_from_raw_egrc_value(squeeze_raw)

        if config.has_section(SUBSTITUTION_SECTION):
            subs = get_substitutions_from_config(config)

        return Config(
            examples_dir=examples_dir,
            custom_dir=custom_dir,
            color_config=color_config,
            use_color=use_color,
            pager_cmd=pager_cmd,
            editor_cmd=editor_cmd,
            squeeze=squeeze,
            subs=subs,
        )

    Create a Config named tuple from the values specified in the .egrc. Expands
    any paths as necessary.

    egrc_path must exist and point a file.

    If not present in the .egrc, properties of the Config are returned as None.
    
eg/config.py