Matoking / protontricks

A wrapper that does winetricks things for Proton enabled games, requires Winetricks.
GNU General Public License v3.0
1.61k stars 34 forks source link

[Arch] UnicodeDecodeError: 'utf-8' codec can't decode byte in position #205

Closed kir68k closed 1 year ago

kir68k commented 1 year ago

Describe the bug Using flatpak, protontricks and protontricks-git from AUR, protontricks always quits on the command protontricks 244210 -q dotnet472, with the Python error UnicodeDecodeError: 'utf-8' codec can't decode byte 0xde in position 444: invalid continuation byte

To Reproduce Steps to reproduce the behavior:

  1. Run command protontricks 244210 -q dotnet472
  2. Command fails and error is displayed

Expected behavior Expected behavior would be protontricks successfully installing dotnet472 for the 244210 appid.

System (please complete the following information):

Additional context The ´-v` flag doesn't give anything useful, as this is a Python error.

I'm not really sure why this happens now... I remember using protontricks on this appid around a week ago and it completing.

The complete error would be as follows:

Traceback (most recent call last):
  File "/app/bin/protontricks", line 8, in <module>
    sys.exit(cli())
  File "/app/lib/python3.10/site-packages/protontricks/cli/main.py", line 32, in cli
    main(args)
  File "/app/lib/python3.10/site-packages/protontricks/cli/util.py", line 149, in wrapper
    return cli_func(self, *args, **kwargs)
  File "/app/lib/python3.10/site-packages/protontricks/cli/main.py", line 328, in main
    proton_app = find_proton_app(
  File "/app/lib/python3.10/site-packages/protontricks/steam.py", line 796, in find_proton_app
    tool_app = find_steam_compat_tool_app(
  File "/app/lib/python3.10/site-packages/protontricks/steam.py", line 579, in find_steam_compat_tool_app
    content = config_vdf_path.read_text()
  File "/usr/lib/python3.10/pathlib.py", line 1135, in read_text
    return f.read()
  File "/usr/lib/python3.10/codecs.py", line 322, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xde in position 444: invalid continuation byte

I wish I could solve this myself, but Python and its errors give me headaches... Also, I have tried this from another issue, but pipx fails on me not recognizing --spec.

Matoking commented 1 year ago

Protontricks seems to fail when reading the configuration file at ~/.steam/steam/config/config.vdf, and early on at that. It could be corrupted or contain some unexpected non-UTF-8 symbols.

Could you try copying the first hundred lines or so from that file and posting them to Github Gist:

https://gist.github.com/

To be exact, Protontricks encounters an unexpected 444 characters into the file so the first hundred lines should contain it as well as any related context.

kir68k commented 1 year ago

gist

I think this line might be of issue, not sure why those characters are there. Removing them and saving the file makes Protontricks work again, so it was never an issue of the program...

Although I'm not sure how those characters got there in the first place. I think it's safe to close the issue.

kir68k commented 1 year ago

Something weird is happening I think related to this program... After every time I use protontricks to install a dotnet version, those characters come back and I get this error again.