DavidoTek / ProtonUp-Qt

Install and manage GE-Proton, Luxtorpeda & more for Steam and Wine-GE & more for Lutris with this graphical user interface.
https://davidotek.github.io/protonup-qt
GNU General Public License v3.0
1.18k stars 39 forks source link

UnboundLocalError on startup #246

Closed Dandraghas closed 1 year ago

Dandraghas commented 1 year ago

Describe the bug
for some reason, after steam update ProtonUp-Qt doesn't launch because of this:

Error: Could not get a list of all Steam apps: 'NoneType' object has no attribute 'get'
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/app/lib/python3.10/site-packages/pupgui2/__main__.py", line 2, in <module>
    main()
  File "/app/lib/python3.10/site-packages/pupgui2/pupgui2.py", line 549, in main
    MainWindow()
  File "/app/lib/python3.10/site-packages/pupgui2/pupgui2.py", line 108, in __init__
    self.update_ui()
  File "/app/lib/python3.10/site-packages/pupgui2/pupgui2.py", line 223, in update_ui
    get_steam_app_list(install_loc.get('vdf_dir'), cached=False)  # update app list cache
  File "/app/lib/python3.10/site-packages/pupgui2/steamutil.py", line 74, in get_steam_app_list
    apps.extend(get_steam_shortcuts_list(steam_config_folder, c))
UnboundLocalError: local variable 'c' referenced before assignment

To Reproduce
Steps to reproduce the behavior:

  1. Launch ProtonUp-Qt
  2. See that it doesnt launch because of error

Expected behavior
ProtonUp-Qt launches without error.

Desktop (please complete the following information):

Terminal output

ProtonUp-Qt 2.8.0 by DavidoTek. Build Info: DavidoTek Flathub build.
Python 3.10.6 (main, Nov 10 2011, 15:00:00) [GCC 12.2.0], PySide 6.4.3
Platform: KDE Flatpak runtime 5.15-21.08 Linux-6.2.15-300.fc38.x86_64-x86_64-with-glibc2.35
Loading locale en / en_US
Loaded ctmod GE-Proton
Loaded ctmod Wine-GE
Loaded ctmod Boxtron
Loaded ctmod D8VK (nightly)
Loaded ctmod Kron4ek Wine-Builds Vanilla
Loaded ctmod Lutris-Wine
Loaded ctmod Luxtorpeda
Loaded ctmod NorthStar Proton (TitanFall 2)
Loaded ctmod Proton Tkg
Loaded ctmod Proton Tkg (Wine Master)
Loaded ctmod Roberta
Loaded ctmod Steam-Play-None
cat: /etc/lsb-release: No such file or directory
Loaded ctmod SteamTinkerLaunch
cat: /etc/lsb-release: No such file or directory
Loaded ctmod SteamTinkerLaunch-git
Loaded ctmod vkd3d-lutris
Loaded ctmod vkd3d-proton
Loaded ctmod Wine Tkg (Valve Wine)
Loaded ctmod Wine Tkg (Vanilla Wine)
Loaded ctmod DXVK
Loaded ctmod DXVK Async
Loaded ctmod DXVK (nightly)
qt.pysideplugin: Environment variable PYSIDE_DESIGNER_PLUGINS is not set, bailing out.
qt.pysideplugin: No instance of QPyDesignerCustomWidgetCollection was found.
Error: Could not get a list of all Steam apps: 'NoneType' object has no attribute 'get'
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/app/lib/python3.10/site-packages/pupgui2/__main__.py", line 2, in <module>
    main()
  File "/app/lib/python3.10/site-packages/pupgui2/pupgui2.py", line 549, in main
    MainWindow()
  File "/app/lib/python3.10/site-packages/pupgui2/pupgui2.py", line 108, in __init__
    self.update_ui()
  File "/app/lib/python3.10/site-packages/pupgui2/pupgui2.py", line 223, in update_ui
    get_steam_app_list(install_loc.get('vdf_dir'), cached=False)  # update app list cache
  File "/app/lib/python3.10/site-packages/pupgui2/steamutil.py", line 74, in get_steam_app_list
    apps.extend(get_steam_shortcuts_list(steam_config_folder, c))
UnboundLocalError: local variable 'c' referenced before assignment
Gamepad error: No gamepad found.
QThread: Destroyed while thread is still running
/app/bin/net.davidotek.pupgui2: line 3:     3 Aborted                 (core dumped) python3 -m pupgui2 "$@"
sonic2kk commented 1 year ago

Duplicate of (from issues I can recall):

The issue should be fixed on main and will be fixed in the next release. The issue occurs to my knowledge because some Steam files are incorrect, and main has some workarounds (one of the keys is written as valve instead of Valve). In some cases it is because some distros use different paths for the Steam client (which main has logic in place to better detect).