bilelmoussaoui / Hardcode-Tray

Fixes Hardcoded tray icons in Linux
Other
864 stars 63 forks source link

command hardcode-tray returns an error : local variable 'data' referenced before assignment #777

Open ijash opened 4 days ago

ijash commented 4 days ago

Specifications

Expected behavior and actual behavior

Expected: run without error Actual: returns an error

Steps to reproduce the problem

  1. execute:
    sudo -E hardcode-tray --conversion-tool RSVGConvert --size 16 --theme Papirus
  2. do the 1- apply
    ijash@lm-wp:~$ sudo -E hardcode-tray --conversion-tool RSVGConvert --size 16 --theme Papirus
    Welcome to Hardcode-Tray!
    Hardcode-Tray replaces some icons on the binary files of some applications. 
    Please close all the running applications before running Hardcode-Tray script.
    Desktop Environment: Cinnamon
    Scaling Factor: 1
    Icon Size: 16
    Icon Theme: Papirus
    Conversion Tool: RSVGConvert
    To Do: All
    1 - Apply
    2 - Revert
    3 - Clear Backup Cache
    Please choose: 1
    Applying now…
  3. error:
    
    Traceback (most recent call last):
    File "/usr/bin/hardcode-tray", line 123, in <module>
    App.execute()
    File "/usr/lib/python3/dist-packages/HardcodeTray/app.py", line 100, in execute
    apps = App.get_supported_apps()
    File "/usr/lib/python3/dist-packages/HardcodeTray/app.py", line 90, in get_supported_apps
    application_data = Parser(db_file)
    File "/usr/lib/python3/dist-packages/HardcodeTray/modules/parser.py", line 47, in __init__
    self._read()
    File "/usr/lib/python3/dist-packages/HardcodeTray/modules/parser.py", line 91, in _read
    self._parse_paths(data["app_path"], "app_path")
    UnboundLocalError: local variable 'data' referenced before assignment
    Error in sys.excepthook:
    Traceback (most recent call last):
    File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 153, in apport_excepthook
    with os.fdopen(os.open(pr_filename,
    FileNotFoundError: [Errno 2] No such file or directory: '/var/crash/_usr_bin_hardcode-tray.0.crash'

Original exception was: Traceback (most recent call last): File "/usr/bin/hardcode-tray", line 123, in App.execute() File "/usr/lib/python3/dist-packages/HardcodeTray/app.py", line 100, in execute apps = App.get_supported_apps() File "/usr/lib/python3/dist-packages/HardcodeTray/app.py", line 90, in get_supported_apps application_data = Parser(db_file) File "/usr/lib/python3/dist-packages/HardcodeTray/modules/parser.py", line 47, in init self._read() File "/usr/lib/python3/dist-packages/HardcodeTray/modules/parser.py", line 91, in _read self._parse_paths(data["app_path"], "app_path") UnboundLocalError: local variable 'data' referenced before assignment


<!-- Add a few screenshots (optional): -->
ijash commented 4 days ago

been reported at https://github.com/PapirusDevelopmentTeam/papirus-icon-theme/issues/3825 but this was hardcode-tray specific error.