def METHOD_NAME(self, filename):
    content = filesystem.read_file(filename)
    # Delete comments and whitespace.
    lines = [delete_comment(line.strip()) for line in content.splitlines()]
    dictionary = {}
    for line in lines:
        if "=" not in line:
            continue
        pair = line.partition("=")[::2]
        key, value = (s.strip() for s in pair)
        # Skip obsolete keys to prevent rewriting them to disk.
        if key in self.obsolete_keys:
            continue
        try:
            value = int(value)
        except ValueError:
            pass
        dictionary[key] = value
    return dictionary