from typing import Mapping


def delimited_file_to_dict(path : str, 
                      delimiter : str=',') -> Mapping[str,str]: 
    """
    Returns a dictionary populated by lines from a file where 
    the first delimited element of each line is the key and
    the second delimited element is the value. 
  
    :param str path: path to file
    :param str delimiter: delimiter separating key and value
    :return: dict containing key -> value
    :rtype: Mapping[str,str]
    :raise: UnsupportedOperation if there's an error in reading
            the file
    """
    values : Mapping[str,str] = {}
    
    with open(path,'a+') as f:
         f.seek(0)
         for line in f:
            line = line.rstrip()
            key,value = line.split(delimiter)
            values[key] = value
    return values