def _get_egrc_config(egrc_path):
    """
    Return a config object based on the config file at the given path.
    """
    with open(egrc_path, 'r') as egrc:
        try:
            config = ConfigParser.RawConfigParser()
        except AttributeError:
            config = ConfigParser()
        # as in config.py, try and support Python 3.12 and above as well
        try:
            config.readfp(egrc)
        except AttributeError:
            config.read_file(egrc)
    return config

    Return a config object based on the config file at the given path.
    
test/config_test.py