diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c4dcbe..b087893 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Changed - `protontricks -c` and `protontricks-launch` now use the current working directory instead of the game's installation directory. `--cwd-app` can be used to restore old behavior. Scripts can also `$STEAM_APP_PATH` environment variable to determine the game's installation directory; this has been supported (albeit undocumented) since 1.8.0. +### Fixed + - Fix Protontricks crash when `config.vdf` contains invalid UTF-8 characters + ## [1.11.1] - 2024-02-20 ### Fixed - Fix Protontricks crash when custom Proton has an invalid or empty `compatibilitytool.vdf` manifest diff --git a/src/protontricks/steam.py b/src/protontricks/steam.py index 00e4bf0..df733b8 100644 --- a/src/protontricks/steam.py +++ b/src/protontricks/steam.py @@ -655,7 +655,10 @@ def _get_tool_app(compat_tool_name, steam_apps, steam_play_manifest): # Multiple configuration values might be found. In such case, select the # one with the highest priority. config_vdf_path = steam_path / "config" / "config.vdf" - content = config_vdf_path.read_text() + # config.vdf might contain invalid UTF-8 characters in the + # `SDL_GamepadBind` field. We don't use that in any way, so we can deal + # with the invalid characters by just ignoring them. + content = config_vdf_path.read_text(errors="replace") vdf_data = lower_dict(vdf.loads(content))