protontricks icon indicating copy to clipboard operation
protontricks copied to clipboard

Protontricks failing with AttributeError: 'NoneType' object has no attribute 'group'

Open Kilinor opened this issue 6 years ago • 5 comments

After running the command: protontricks 359320 dotnet40 win7

I get the following response: [INFO] Found Steam directory at /home/$USER/.steam/steam. You can also define Steam directory manually using $STEAM_DIR [INFO] WINETRICKS environment variable is not available. Falling back to /usr/bin/winetricks [INFO] Found 1 Steam library folders Traceback (most recent call last): File "/usr/bin/protontricks", line 310, in steam_apps = get_steam_apps(steam_lib_dirs) File "/usr/bin/protontricks", line 250, in get_steam_apps steam_app = SteamApp.from_appmanifest(path) File "/usr/bin/protontricks", line 93, in from_appmanifest appid = int(re.search(r'(\t"appid"\s+")([0-9]+)', content).group(2)) AttributeError: 'NoneType' object has no attribute 'group'

Kilinor avatar Dec 08 '18 03:12 Kilinor

This error occurs when one of the library paths is on an NTFS mount.

Kilinor avatar Dec 08 '18 09:12 Kilinor

@Kilinor Hi,Can you share how do you solved it?

cv-shiyanshi avatar Jan 15 '19 02:01 cv-shiyanshi

this error just occured to me with none of the library paths being on an ntfs mount.

$ protontricks 551770 shell
[INFO] Found Steam directory at /home/kyra/.steam/steam. You can also define Steam directory manually using $STEAM_DIR
[INFO] WINETRICKS environment variable is not available. Falling back to /usr/bin/winetricks
[INFO] Found 0 Steam library folders
Traceback (most recent call last):
  File "/usr/local/bin/protontricks", line 316, in <module>
    steam_dir=steam_dir, steam_apps=steam_apps)
  File "/usr/local/bin/protontricks", line 163, in find_current_proton_app
    proton_appid = re.search(appid_regex, appinfo).group(2)
AttributeError: 'NoneType' object has no attribute 'group'

$ ls .steam/steam/steamapps/compatdata/551770/
pfx  pfx.lock  tracked_files  version

$ mount
(...)
/dev/mapper/vg_pool-lv_root on / type ext4 (rw,relatime)
(...)

interestingly it worked perfectly fine about a week ago.

if i had to guess i'd say valve might be updating their proprietary binary appinfo.vdf format from time to time, breaking compatibility? why do you need to parse that anyway? looks like you're just getting the proton version to use from there, and that's already in plain text in config.vdf (which btw you're also parsing wrong, but at least according to the comment you know that) under "CompatToolMapping"...

nonchip avatar Jul 09 '19 04:07 nonchip

Yup, just happened to me as well. Used to work a few weeks ago. I just did a protontricks -c "pwd" 2100. Seems to only happen with some of the games, not all. Weird.

Judging by the fact that it just started to happen without me updating protontricks, I'd say the fault is probably in the way Steam works. They must have changed something. Or maybe it's because of python 3.7.3, but I doubt it.

cyro666 avatar Jul 10 '19 17:07 cyro666

@cyro666 turns out just using the fork from https://github.com/Matoking/protontricks fixed it :P this repo is not maintained anymore anyway, that's the one @Sirmentio recommends.

as for the reason: they have changed the way their appinfo.vdf cache file works, and this version essentially just greps (not really, but the equivalent in python) it and has a hardcoded offset it reads and then assumes automatic success, while the forked version parses that file a bit more robust.

nonchip avatar Jul 10 '19 21:07 nonchip