prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Failure to read Steam's config.vdf due to wrong case
  Lutris can't read Steam's config.vdf file because the "Steam" value is actually lowercase when Lutris expects it to be uppercase.
  
  ![19:05:34](https://user-images.githubusercontent.com/17669985/72685104-730c4480-3aef-11ea-9217-4df94fac22bd.png)
  
  Same as #1966.
  Failure to read Steam's config.vdf due to wrong case
  Lutris can't read Steam's config.vdf file because the "Steam" value is actually lowercase when Lutris expects it to be uppercase.
  
  ![19:05:34](https://user-images.githubusercontent.com/17669985/72685104-730c4480-3aef-11ea-9217-4df94fac22bd.png)
  
  Same as #1966.
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `lutris/util/steam/config.py`
  Content:
  ```
  1 """Handle Steam configuration"""
  2 import os
  3 from collections import OrderedDict, defaultdict
  4 
  5 from lutris.util import system
  6 from lutris.util.log import logger
  7 from lutris.util.steam.vdf import vdf_parse
  8 
  9 
  10 def get_default_acf(appid, name):
  11     """Return a default configuration usable to
  12     create a runnable game in Steam"""
  13 
  14     userconfig = OrderedDict()
  15     userconfig["name"] = name
  16     userconfig["gameid"] = appid
  17 
  18     appstate = OrderedDict()
  19     appstate["appID"] = appid
  20     appstate["Universe"] = "1"
  21     appstate["StateFlags"] = "1026"
  22     appstate["installdir"] = name
  23     appstate["UserConfig"] = userconfig
  24     return {"AppState": appstate}
  25 
  26 
  27 def read_config(steam_data_dir):
  28     """Read the Steam configuration and return it as an object"""
  29     config_filename = os.path.join(steam_data_dir, "config/config.vdf")
  30     if not system.path_exists(config_filename):
  31         return None
  32     with open(config_filename, "r") as steam_config_file:
  33         config = vdf_parse(steam_config_file, {})
  34     try:
  35         return config["InstallConfigStore"]["Software"]["Valve"]["Steam"]
  36     except KeyError:
  37         try:
  38             return config["InstallConfigStore"]["Software"]["valve"]["Steam"]
  39         except KeyError as ex:
  40             logger.error("Steam config %s is empty: %s", config_filename, ex)
  41 
  42 
  43 def get_steamapps_paths_for_platform(platform_name):
  44     """
  45     """
  46     from lutris.runners import winesteam, steam
  47 
  48     runners = {"linux": steam.steam, "windows": winesteam.winesteam}
  49     runner = runners[platform_name]()
  50     return runner.get_steamapps_dirs()
  51 
  52 
  53 def get_steamapps_paths(flat=False, platform=None):
  54     base_platforms = ["linux", "windows"]
  55     if flat:
  56         steamapps_paths = []
  57     else:
  58         steamapps_paths = defaultdict(list)
  59 
  60     if platform:
  61         if platform not in base_platforms:
  62             raise ValueError("Illegal value for Steam platform: %s" % platform)
  63         platforms = [platform]
  64     else:
  65         platforms = base_platforms
  66 
  67     for _platform in platforms:
  68         folders = get_steamapps_paths_for_platform(_platform)
  69         if flat:
  70             steamapps_paths += folders
  71         else:
  72             steamapps_paths[_platform] = folders
  73 
  74     return steamapps_paths
  75
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/lutris/util/steam/config.py b/lutris/util/steam/config.py
  --- a/lutris/util/steam/config.py
  +++ b/lutris/util/steam/config.py
  @@ -26,18 +26,25 @@
   
   def read_config(steam_data_dir):
       """Read the Steam configuration and return it as an object"""
  +
  +    def get_entry_case_insensitive(config_dict, path):
  +        for key, value in config_dict.items():
  +            if key.lower() == path[0].lower():
  +                if len(path) <= 1:
  +                    return config_dict[key]
  +
  +                return get_entry_case_insensitive(config_dict[key], path[1:])
  +        raise KeyError(path[0])
  +
       config_filename = os.path.join(steam_data_dir, "config/config.vdf")
       if not system.path_exists(config_filename):
           return None
       with open(config_filename, "r") as steam_config_file:
           config = vdf_parse(steam_config_file, {})
       try:
  -        return config["InstallConfigStore"]["Software"]["Valve"]["Steam"]
  -    except KeyError:
  -        try:
  -            return config["InstallConfigStore"]["Software"]["valve"]["Steam"]
  -        except KeyError as ex:
  -            logger.error("Steam config %s is empty: %s", config_filename, ex)
  +        return get_entry_case_insensitive(config, ["InstallConfigStore", "Software", "Valve", "Steam"])
  +    except KeyError as ex:
  +        logger.error("Steam config %s is empty: %s", config_filename, ex)
   
   
   def get_steamapps_paths_for_platform(platform_name):
  
verification_info: {"golden_diff": "diff --git a/lutris/util/steam/config.py b/lutris/util/steam/config.py\n--- a/lutris/util/steam/config.py\n+++ b/lutris/util/steam/config.py\n@@ -26,18 +26,25 @@\n \n def read_config(steam_data_dir):\n     \"\"\"Read the Steam configuration and return it as an object\"\"\"\n+\n+    def get_entry_case_insensitive(config_dict, path):\n+        for key, value in config_dict.items():\n+            if key.lower() == path[0].lower():\n+                if len(path) <= 1:\n+                    return config_dict[key]\n+\n+                return get_entry_case_insensitive(config_dict[key], path[1:])\n+        raise KeyError(path[0])\n+\n     config_filename = os.path.join(steam_data_dir, \"config/config.vdf\")\n     if not system.path_exists(config_filename):\n         return None\n     with open(config_filename, \"r\") as steam_config_file:\n         config = vdf_parse(steam_config_file, {})\n     try:\n-        return config[\"InstallConfigStore\"][\"Software\"][\"Valve\"][\"Steam\"]\n-    except KeyError:\n-        try:\n-            return config[\"InstallConfigStore\"][\"Software\"][\"valve\"][\"Steam\"]\n-        except KeyError as ex:\n-            logger.error(\"Steam config %s is empty: %s\", config_filename, ex)\n+        return get_entry_case_insensitive(config, [\"InstallConfigStore\", \"Software\", \"Valve\", \"Steam\"])\n+    except KeyError as ex:\n+        logger.error(\"Steam config %s is empty: %s\", config_filename, ex)\n \n \n def get_steamapps_paths_for_platform(platform_name):\n", "issue": "Failure to read Steam's config.vdf due to wrong case\nLutris can't read Steam's config.vdf file because the \"Steam\" value is actually lowercase when Lutris expects it to be uppercase.\r\n\r\n![19:05:34](https://user-images.githubusercontent.com/17669985/72685104-730c4480-3aef-11ea-9217-4df94fac22bd.png)\r\n\r\nSame as #1966.\nFailure to read Steam's config.vdf due to wrong case\nLutris can't read Steam's config.vdf file because the \"Steam\" value is actually lowercase when Lutris expects it to be uppercase.\r\n\r\n![19:05:34](https://user-images.githubusercontent.com/17669985/72685104-730c4480-3aef-11ea-9217-4df94fac22bd.png)\r\n\r\nSame as #1966.\n", "before_files": [{"content": "\"\"\"Handle Steam configuration\"\"\"\nimport os\nfrom collections import OrderedDict, defaultdict\n\nfrom lutris.util import system\nfrom lutris.util.log import logger\nfrom lutris.util.steam.vdf import vdf_parse\n\n\ndef get_default_acf(appid, name):\n    \"\"\"Return a default configuration usable to\n    create a runnable game in Steam\"\"\"\n\n    userconfig = OrderedDict()\n    userconfig[\"name\"] = name\n    userconfig[\"gameid\"] = appid\n\n    appstate = OrderedDict()\n    appstate[\"appID\"] = appid\n    appstate[\"Universe\"] = \"1\"\n    appstate[\"StateFlags\"] = \"1026\"\n    appstate[\"installdir\"] = name\n    appstate[\"UserConfig\"] = userconfig\n    return {\"AppState\": appstate}\n\n\ndef read_config(steam_data_dir):\n    \"\"\"Read the Steam configuration and return it as an object\"\"\"\n    config_filename = os.path.join(steam_data_dir, \"config/config.vdf\")\n    if not system.path_exists(config_filename):\n        return None\n    with open(config_filename, \"r\") as steam_config_file:\n        config = vdf_parse(steam_config_file, {})\n    try:\n        return config[\"InstallConfigStore\"][\"Software\"][\"Valve\"][\"Steam\"]\n    except KeyError:\n        try:\n            return config[\"InstallConfigStore\"][\"Software\"][\"valve\"][\"Steam\"]\n        except KeyError as ex:\n            logger.error(\"Steam config %s is empty: %s\", config_filename, ex)\n\n\ndef get_steamapps_paths_for_platform(platform_name):\n    \"\"\"\n    \"\"\"\n    from lutris.runners import winesteam, steam\n\n    runners = {\"linux\": steam.steam, \"windows\": winesteam.winesteam}\n    runner = runners[platform_name]()\n    return runner.get_steamapps_dirs()\n\n\ndef get_steamapps_paths(flat=False, platform=None):\n    base_platforms = [\"linux\", \"windows\"]\n    if flat:\n        steamapps_paths = []\n    else:\n        steamapps_paths = defaultdict(list)\n\n    if platform:\n        if platform not in base_platforms:\n            raise ValueError(\"Illegal value for Steam platform: %s\" % platform)\n        platforms = [platform]\n    else:\n        platforms = base_platforms\n\n    for _platform in platforms:\n        folders = get_steamapps_paths_for_platform(_platform)\n        if flat:\n            steamapps_paths += folders\n        else:\n            steamapps_paths[_platform] = folders\n\n    return steamapps_paths\n", "path": "lutris/util/steam/config.py"}], "after_files": [{"content": "\"\"\"Handle Steam configuration\"\"\"\nimport os\nfrom collections import OrderedDict, defaultdict\n\nfrom lutris.util import system\nfrom lutris.util.log import logger\nfrom lutris.util.steam.vdf import vdf_parse\n\n\ndef get_default_acf(appid, name):\n    \"\"\"Return a default configuration usable to\n    create a runnable game in Steam\"\"\"\n\n    userconfig = OrderedDict()\n    userconfig[\"name\"] = name\n    userconfig[\"gameid\"] = appid\n\n    appstate = OrderedDict()\n    appstate[\"appID\"] = appid\n    appstate[\"Universe\"] = \"1\"\n    appstate[\"StateFlags\"] = \"1026\"\n    appstate[\"installdir\"] = name\n    appstate[\"UserConfig\"] = userconfig\n    return {\"AppState\": appstate}\n\n\ndef read_config(steam_data_dir):\n    \"\"\"Read the Steam configuration and return it as an object\"\"\"\n\n    def get_entry_case_insensitive(config_dict, path):\n        for key, value in config_dict.items():\n            if key.lower() == path[0].lower():\n                if len(path) <= 1:\n                    return config_dict[key]\n\n                return get_entry_case_insensitive(config_dict[key], path[1:])\n        raise KeyError(path[0])\n\n    config_filename = os.path.join(steam_data_dir, \"config/config.vdf\")\n    if not system.path_exists(config_filename):\n        return None\n    with open(config_filename, \"r\") as steam_config_file:\n        config = vdf_parse(steam_config_file, {})\n    try:\n        return get_entry_case_insensitive(config, [\"InstallConfigStore\", \"Software\", \"Valve\", \"Steam\"])\n    except KeyError as ex:\n        logger.error(\"Steam config %s is empty: %s\", config_filename, ex)\n\n\ndef get_steamapps_paths_for_platform(platform_name):\n    \"\"\"\n    \"\"\"\n    from lutris.runners import winesteam, steam\n\n    runners = {\"linux\": steam.steam, \"windows\": winesteam.winesteam}\n    runner = runners[platform_name]()\n    return runner.get_steamapps_dirs()\n\n\ndef get_steamapps_paths(flat=False, platform=None):\n    base_platforms = [\"linux\", \"windows\"]\n    if flat:\n        steamapps_paths = []\n    else:\n        steamapps_paths = defaultdict(list)\n\n    if platform:\n        if platform not in base_platforms:\n            raise ValueError(\"Illegal value for Steam platform: %s\" % platform)\n        platforms = [platform]\n    else:\n        platforms = base_platforms\n\n    for _platform in platforms:\n        folders = get_steamapps_paths_for_platform(_platform)\n        if flat:\n            steamapps_paths += folders\n        else:\n            steamapps_paths[_platform] = folders\n\n    return steamapps_paths\n", "path": "lutris/util/steam/config.py"}]}